aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2012-01-10 12:52:01 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2012-01-10 12:52:01 +0100
commitc2d6792ddb8d968e0c93a7cdd1da7bdae3b5fa36 (patch)
tree4db3057932963fbb13811c907e5abb5ea144daa8 /mediagoblin/tests
parent1dc7f28d2476135f9548a92ec1147659f1a4e810 (diff)
downloadmediagoblin-c2d6792ddb8d968e0c93a7cdd1da7bdae3b5fa36.tar.lz
mediagoblin-c2d6792ddb8d968e0c93a7cdd1da7bdae3b5fa36.tar.xz
mediagoblin-c2d6792ddb8d968e0c93a7cdd1da7bdae3b5fa36.zip
Test Suite: Enable attachments, add failing test
attachments are an optional part. But it doesn't hurt to enable them in the test suite at all. Also (with enabled attachmemtns) the main media view fails, if one isn't logged in (joar found it!). So add a simple (currently failing) test for this.
Diffstat (limited to 'mediagoblin/tests')
-rw-r--r--mediagoblin/tests/test_mgoblin_app.ini3
-rw-r--r--mediagoblin/tests/test_submission.py14
2 files changed, 17 insertions, 0 deletions
diff --git a/mediagoblin/tests/test_mgoblin_app.ini b/mediagoblin/tests/test_mgoblin_app.ini
index 2525a4f9..c91ed92b 100644
--- a/mediagoblin/tests/test_mgoblin_app.ini
+++ b/mediagoblin/tests/test_mgoblin_app.ini
@@ -7,6 +7,9 @@ db_name = __mediagoblin_tests__
# tag parsing
tags_max_length = 50
+# So we can start to test attachments:
+allow_attachments = True
+
# Celery shouldn't be set up by the application as it's setup via
# mediagoblin.init.celery.from_celery
celery_setup_elsewhere = true
diff --git a/mediagoblin/tests/test_submission.py b/mediagoblin/tests/test_submission.py
index 2b17c515..b3c11249 100644
--- a/mediagoblin/tests/test_submission.py
+++ b/mediagoblin/tests/test_submission.py
@@ -51,11 +51,17 @@ class TestSubmission:
self.test_user = test_user
+ self.login()
+
+ def login(self):
self.test_app.post(
'/auth/login/', {
'username': u'chris',
'password': 'toast'})
+ def logout(self):
+ self.test_app.get('/auth/logout/')
+
def test_missing_fields(self):
# Test blank form
# ---------------
@@ -95,6 +101,14 @@ class TestSubmission:
assert template.TEMPLATE_TEST_CONTEXT.has_key(
'mediagoblin/user_pages/user.html')
+ # Make sure the media view is at least reachable, logged in...
+ self.test_app.get('/u/chris/m/normal-upload-1/')
+ # ... and logged out too.
+ self.logout()
+ self.test_app.get('/u/chris/m/normal-upload-1/')
+ # Log back in for the remaining tests.
+ self.login()
+
# Test PNG
# --------
template.clear_test_template_context()