Moved unit test to its proper spot, and added @httpretty.activate

This commit is contained in:
2016-03-04 18:43:20 +01:00
parent da601747bb
commit 93439be9ac

View File

@@ -42,10 +42,6 @@ class AuthenticationTests(unittest.TestCase):
auth.create_new_user(TEST_EMAIL_ADDRESS, TEST_EMAIL_USER, 'test1234')
self.assertEqual('%s1' % TEST_EMAIL_USER, auth.make_unique_username(TEST_EMAIL_ADDRESS))
def test_validate_token__not_logged_in(self):
with app.test_request_context():
self.assertFalse(auth.validate_token())
def delete_test_data(self):
app.data.driver.db.drop_collection('users')
app.data.driver.db.drop_collection('tokens')
@@ -67,6 +63,11 @@ class AuthenticationTests(unittest.TestCase):
'status': 'success'}),
content_type="application/json")
@httpretty.activate
def test_validate_token__not_logged_in(self):
with app.test_request_context():
self.assertFalse(auth.validate_token())
@httpretty.activate
def test_validate_token__unknown_token(self):
"""Test validating of invalid token, unknown both to us and Blender ID."""