Fix the data integrity bug in test_misc.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 22 Jun 2013 22:37:30 +0000 (17:37 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 22 Jun 2013 22:37:30 +0000 (17:37 -0500)
It turns out this has to do with some additions to the fixture adding
of media entries.  Since the new fake_upload field is True by default,
adding multiple entries that have media_files at once meant that
multiple additions of FileKeynames would be added at once if they were
not saved at the same time.  Tricky!

Thankfully, Elrond helped us figure this one out.  Thanks, Elrond :)

And thanks also to Aapo Rantalainen for sponsoring this commit!

mediagoblin/tests/test_misc.py

index 6af6bf92edb97abf28c0b4a5c721d4e0db052159..43ad0b6d67c7a40d77f03b48e51514b8464c682e 100644 (file)
@@ -29,9 +29,9 @@ def test_user_deletes_other_comments(test_app):
     user_b = fixture_add_user(u"chris_b")
 
     media_a = fixture_media_entry(uploader=user_a.id, save=False,
-                                  expunge=False)
+                                  expunge=False, fake_upload=False)
     media_b = fixture_media_entry(uploader=user_b.id, save=False,
-                                  expunge=False)
+                                  expunge=False, fake_upload=False)
     Session.add(media_a)
     Session.add(media_b)
     Session.flush()