diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-01-11 14:18:27 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-01-11 21:48:03 +0100 |
commit | 461dd9717cce6c5b4d40bb4e76ca65d9d898d1df (patch) | |
tree | 9b55136a4c5353ed3e65dc6c82f7ecad7d2cd784 /mediagoblin/tests/test_submission.py | |
parent | 8b271c28bd4c0b9c90990d87c1dfd0d8d95b9e45 (diff) | |
download | mediagoblin-461dd9717cce6c5b4d40bb4e76ca65d9d898d1df.tar.lz mediagoblin-461dd9717cce6c5b4d40bb4e76ca65d9d898d1df.tar.xz mediagoblin-461dd9717cce6c5b4d40bb4e76ca65d9d898d1df.zip |
Start to use the media_id in "admin" URLs.
We have a bunch of URLs that are more for internal use. At
least they're definitely not intended to be posted
somewhere for long term useage.
When those things affect a media, it's much better to
reference the media by its id. This can't change, ever.
This is better for races.
Like someone posting a comment while the owner
corrects a typo in the slug.
Diffstat (limited to 'mediagoblin/tests/test_submission.py')
-rw-r--r-- | mediagoblin/tests/test_submission.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mediagoblin/tests/test_submission.py b/mediagoblin/tests/test_submission.py index faf4e744..53330c48 100644 --- a/mediagoblin/tests/test_submission.py +++ b/mediagoblin/tests/test_submission.py @@ -161,11 +161,17 @@ class TestSubmission: media = self.check_media(request, {'title': u'Balanced Goblin'}, 1) media_id = media.id + # At least render the edit page + edit_url = request.urlgen( + 'mediagoblin.edit.edit_media', + user=self.test_user.username, media_id=media_id) + self.test_app.get(edit_url) + # Add a comment, so we can test for its deletion later. self.check_comments(request, media_id, 0) comment_url = request.urlgen( 'mediagoblin.user_pages.media_post_comment', - user=self.test_user.username, media=media_id) + user=self.test_user.username, media_id=media_id) response = self.do_post({'comment_content': 'i love this test'}, url=comment_url, do_follow=True)[0] self.check_comments(request, media_id, 1) @@ -174,7 +180,7 @@ class TestSubmission: # --------------------------------------------------- delete_url = request.urlgen( 'mediagoblin.user_pages.media_confirm_delete', - user=self.test_user.username, media=media_id) + user=self.test_user.username, media_id=media_id) # Empty data means don't confirm response = self.do_post({}, do_follow=True, url=delete_url)[0] media = self.check_media(request, {'title': u'Balanced Goblin'}, 1) |