diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-06-22 17:40:12 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-06-22 17:40:12 -0500 |
commit | c3de34d431c74fbdd44e08a5a4714a7a507b8e17 (patch) | |
tree | 948b67f8b7e301e3164c2fbecb5d05e6e1321a83 /mediagoblin/tests/tools.py | |
parent | 56d1346789c2b628aa1af986c101010c426ecc56 (diff) | |
download | mediagoblin-c3de34d431c74fbdd44e08a5a4714a7a507b8e17.tar.lz mediagoblin-c3de34d431c74fbdd44e08a5a4714a7a507b8e17.tar.xz mediagoblin-c3de34d431c74fbdd44e08a5a4714a7a507b8e17.zip |
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!
Diffstat (limited to 'mediagoblin/tests/tools.py')
-rw-r--r-- | mediagoblin/tests/tools.py | 8 |
1 files changed, 8 insertions, 0 deletions
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 |