diff options
author | Jessica Tallon <tsyesika@tsyesika.se> | 2015-10-07 13:13:40 +0200 |
---|---|---|
committer | Jessica Tallon <tsyesika@tsyesika.se> | 2015-10-07 15:07:54 +0200 |
commit | d216d771f662fc3e0a3417ce06e8355abce99988 (patch) | |
tree | 7502682047ad22ec40d13d18ffb84a284d1e92ac /mediagoblin/tests | |
parent | bc75a6532712e4b9b0f6d8b5bbd93db3ef58335d (diff) | |
download | mediagoblin-d216d771f662fc3e0a3417ce06e8355abce99988.tar.lz mediagoblin-d216d771f662fc3e0a3417ce06e8355abce99988.tar.xz mediagoblin-d216d771f662fc3e0a3417ce06e8355abce99988.zip |
Add public_id fixes throughout the code
This adds several things, mainly code which checks for the public id and
if it doesn't exist generating it where it can. This is to because we
need to keep the public_id to be able to effectively soft delete models.
This also adds a public_id field to the Activity along with a migration.
Diffstat (limited to 'mediagoblin/tests')
-rw-r--r-- | mediagoblin/tests/test_submission.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mediagoblin/tests/test_submission.py b/mediagoblin/tests/test_submission.py index 55394670..c0c3d3cf 100644 --- a/mediagoblin/tests/test_submission.py +++ b/mediagoblin/tests/test_submission.py @@ -153,6 +153,16 @@ class TestSubmission: # Reload user assert self.our_user().uploaded == file_size + def test_public_id_populated(self): + # Upload the image first. + response, request = self.do_post({'title': u'Balanced Goblin'}, + *REQUEST_CONTEXT, do_follow=True, + **self.upload_data(GOOD_JPG)) + media = self.check_media(request, {'title': u'Balanced Goblin'}, 1) + + # Now check that the public_id attribute is set. + assert media.public_id != None + def test_normal_png(self): self.check_normal_upload(u'Normal upload 2', GOOD_PNG) |