From c3de34d431c74fbdd44e08a5a4714a7a507b8e17 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 22 Jun 2013 17:40:12 -0500 Subject: [PATCH] Adding a docstring to fixture_media_entry It's not complete, but it makes clearer how to avoid errors with fake_upload :) This commit sponsored by Harper Sanford. Thank you! --- mediagoblin/tests/tools.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mediagoblin/tests/tools.py b/mediagoblin/tests/tools.py index 836072b3..222649f1 100644 --- a/mediagoblin/tests/tools.py +++ b/mediagoblin/tests/tools.py @@ -234,6 +234,14 @@ def fixture_media_entry(title=u"Some title", slug=None, uploader=None, save=True, gen_slug=True, state=u'unprocessed', fake_upload=True, expunge=True): + """ + Add a media entry for testing purposes. + + Caution: if you're adding multiple entries with fake_upload=True, + make sure you save between them... otherwise you'll hit an + IntegrityError from multiple newly-added-MediaEntries adding + FileKeynames at once. :) + """ if uploader is None: uploader = fixture_add_user().id -- 2.25.1