aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests/test_edit.py
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2011-12-04 14:59:33 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2011-12-04 14:59:33 +0100
commitea5a5b15a3d552eaefc4cf220ed155af06f7c8f7 (patch)
tree3cb34f81f8fa27cb9402f427f3aa0a9691c1a0dd /mediagoblin/tests/test_edit.py
parentbb20c179c43cc9aec2cb7a3160dc734e58961609 (diff)
parent9754802d4bca036b8fb0b50db948dd2eb8f64bd6 (diff)
downloadmediagoblin-ea5a5b15a3d552eaefc4cf220ed155af06f7c8f7.tar.lz
mediagoblin-ea5a5b15a3d552eaefc4cf220ed155af06f7c8f7.tar.xz
mediagoblin-ea5a5b15a3d552eaefc4cf220ed155af06f7c8f7.zip
Merge branch 'misc/fixture_add_user'
* misc/fixture_add_user: fixture_add_user: Factoring a unit test tool
Diffstat (limited to 'mediagoblin/tests/test_edit.py')
-rw-r--r--mediagoblin/tests/test_edit.py21
1 files changed, 4 insertions, 17 deletions
diff --git a/mediagoblin/tests/test_edit.py b/mediagoblin/tests/test_edit.py
index 3637b046..c29ddfe9 100644
--- a/mediagoblin/tests/test_edit.py
+++ b/mediagoblin/tests/test_edit.py
@@ -15,23 +15,16 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from mediagoblin import mg_globals
-from mediagoblin.tests.tools import setup_fresh_app
+from mediagoblin.tests.tools import setup_fresh_app, fixture_add_user
from mediagoblin.tools import template
-from mediagoblin.auth.lib import bcrypt_check_password, \
- bcrypt_gen_password_hash
+from mediagoblin.auth.lib import bcrypt_check_password
@setup_fresh_app
def test_change_password(test_app):
"""Test changing password correctly and incorrectly"""
# set up new user
- test_user = mg_globals.database.User()
- test_user['username'] = u'chris'
- test_user['email'] = u'chris@example.com'
- test_user['email_verified'] = True
- test_user['status'] = u'active'
- test_user['pw_hash'] = bcrypt_gen_password_hash('toast')
- test_user.save()
+ test_user = fixture_add_user()
test_app.post(
'/auth/login/', {
@@ -73,13 +66,7 @@ def test_change_password(test_app):
def change_bio_url(test_app):
"""Test changing bio and URL"""
# set up new user
- test_user = mg_globals.database.User()
- test_user['username'] = u'chris'
- test_user['email'] = u'chris@example.com'
- test_user['email_verified'] = True
- test_user['status'] = u'active'
- test_user['pw_hash'] = bcrypt_gen_password_hash('toast')
- test_user.save()
+ test_user = fixture_add_user()
# test changing the bio and the URL properly
test_app.post(