Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix publish #460

Merged
merged 5 commits into from
Aug 6, 2021
Merged

Fix publish #460

merged 5 commits into from
Aug 6, 2021

Conversation

dchiquito
Copy link
Contributor

Fixes #459

  • Refactor the code that generated published Assets into code that mutates a draft asset into a published asset.
  • Split AssetFactory into DraftAssetFactory and PublishedAssetFactory
  • Add a new test for the publish endpoint that publishes a draft version with a draft asset and a published asset, and verifies that those assets are handled correctly.

`Asset.published_asset()` created a new `Asset`, which is not how
publishing `Asset`s should work. Instead, the `Asset` should be modified
in place, which is what `publish()` does.
`published_metadata()` is also added so that the validation task can get
the metadata of the published `Asset` without actually modifying the
`Asset`.
There are meaningful differences in how draft and published `Assets`
behave, so it makes sense to have two separate test factories.

The `asset` and `asset_factory` fixtures are still available, they
simply run the test twice, once with a draft asset and once with a
published asset.
This test verifies that both draft and published assets are published
properly.
return published_asset
This is useful to validate asset metadata without saving it.
To actually publish this Asset, simply save() after calling publish().
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document the link to bulk_update

Copy link
Member

@waxlamp waxlamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Daniel gave us a walkthrough of the code and everything looks good.

@dchiquito dchiquito merged commit 6bc8ef3 into master Aug 6, 2021
@dchiquito dchiquito deleted the fix-publish branch August 6, 2021 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix publish process
3 participants