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.
This commit is contained in:
Jessica Tallon
2015-10-07 13:13:40 +02:00
parent bc75a65327
commit d216d771f6
7 changed files with 107 additions and 27 deletions

View File

@@ -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)