aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/tests')
-rw-r--r--mediagoblin/tests/test_auth.py8
-rw-r--r--mediagoblin/tests/test_mgoblin_app.ini1
-rw-r--r--mediagoblin/tests/test_misc.py26
-rw-r--r--mediagoblin/tests/test_tags.py9
4 files changed, 31 insertions, 13 deletions
diff --git a/mediagoblin/tests/test_auth.py b/mediagoblin/tests/test_auth.py
index acef3d26..2faf0f25 100644
--- a/mediagoblin/tests/test_auth.py
+++ b/mediagoblin/tests/test_auth.py
@@ -280,16 +280,16 @@ def test_register_views(test_app):
template.clear_test_template_context()
response = test_app.get(
"/auth/forgot_password/verify/?userid=%s&token=total_bs" % unicode(
- new_user._id), status=400)
- assert response.status == '400 Bad Request'
+ new_user._id), status=404)
+ assert_equal(response.status, '404 Not Found')
## Try using an expired token to change password, shouldn't work
template.clear_test_template_context()
real_token_expiration = new_user['fp_token_expire']
new_user['fp_token_expire'] = datetime.datetime.now()
new_user.save()
- response = test_app.get("%s?%s" % (path, get_params), status=400)
- assert response.status == '400 Bad Request'
+ response = test_app.get("%s?%s" % (path, get_params), status=404)
+ assert_equal(response.status, '404 Not Found')
new_user['fp_token_expire'] = real_token_expiration
new_user.save()
diff --git a/mediagoblin/tests/test_mgoblin_app.ini b/mediagoblin/tests/test_mgoblin_app.ini
index f979e810..2525a4f9 100644
--- a/mediagoblin/tests/test_mgoblin_app.ini
+++ b/mediagoblin/tests/test_mgoblin_app.ini
@@ -5,7 +5,6 @@ email_debug_mode = true
db_name = __mediagoblin_tests__
# tag parsing
-tags_delimiter = ","
tags_max_length = 50
# Celery shouldn't be set up by the application as it's setup via
diff --git a/mediagoblin/tests/test_misc.py b/mediagoblin/tests/test_misc.py
new file mode 100644
index 00000000..09623355
--- /dev/null
+++ b/mediagoblin/tests/test_misc.py
@@ -0,0 +1,26 @@
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from nose.tools import assert_equal
+
+from mediagoblin.tests.tools import setup_fresh_app
+
+
+@setup_fresh_app
+def test_404_for_non_existent(test_app):
+ assert_equal(test_app.get('/does-not-exist/',
+ expect_errors=True).status_int,
+ 404)
diff --git a/mediagoblin/tests/test_tags.py b/mediagoblin/tests/test_tags.py
index a05831c9..583c1a55 100644
--- a/mediagoblin/tests/test_tags.py
+++ b/mediagoblin/tests/test_tags.py
@@ -39,11 +39,4 @@ def test_list_of_dicts_conversion(test_app):
# Make sure converting the list of dicts to a string works
assert text.media_tags_as_string([{'name': u'yin', 'slug': u'yin'},
{'name': u'yang', 'slug': u'yang'}]) == \
- u'yin,yang'
-
- # If the tag delimiter is a space then we expect different results
- mg_globals.app_config['tags_delimiter'] = u' '
- assert text.convert_to_tag_list_of_dicts('unicorn ceramic nazi') == [
- {'name': u'unicorn', 'slug': u'unicorn'},
- {'name': u'ceramic', 'slug': u'ceramic'},
- {'name': u'nazi', 'slug': u'nazi'}]
+ u'yin, yang'