Moved unit test to its proper spot, and added @httpretty.activate
This commit is contained in:
parent
da601747bb
commit
93439be9ac
@ -42,10 +42,6 @@ class AuthenticationTests(unittest.TestCase):
|
|||||||
auth.create_new_user(TEST_EMAIL_ADDRESS, TEST_EMAIL_USER, 'test1234')
|
auth.create_new_user(TEST_EMAIL_ADDRESS, TEST_EMAIL_USER, 'test1234')
|
||||||
self.assertEqual('%s1' % TEST_EMAIL_USER, auth.make_unique_username(TEST_EMAIL_ADDRESS))
|
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):
|
def delete_test_data(self):
|
||||||
app.data.driver.db.drop_collection('users')
|
app.data.driver.db.drop_collection('users')
|
||||||
app.data.driver.db.drop_collection('tokens')
|
app.data.driver.db.drop_collection('tokens')
|
||||||
@ -67,6 +63,11 @@ class AuthenticationTests(unittest.TestCase):
|
|||||||
'status': 'success'}),
|
'status': 'success'}),
|
||||||
content_type="application/json")
|
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
|
@httpretty.activate
|
||||||
def test_validate_token__unknown_token(self):
|
def test_validate_token__unknown_token(self):
|
||||||
"""Test validating of invalid token, unknown both to us and Blender ID."""
|
"""Test validating of invalid token, unknown both to us and Blender ID."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user