|
1 | 1 | from unittest import TestCase, main as unittest_main |
2 | 2 |
|
3 | 3 | from webtest import TestApp, AppError |
| 4 | +from namespace_utils.test_class import Test |
4 | 5 |
|
5 | 6 | from oauth2_bottle_app import oauth2_app |
6 | 7 |
|
@@ -65,7 +66,6 @@ def test_3_register_or_login_success_register(self): |
65 | 66 | # Save access token |
66 | 67 | self.__class__.access_token = register_or_login_resp.json['access_token'] |
67 | 68 |
|
68 | | - |
69 | 69 | def test_3_register_or_login_failure_login(self): |
70 | 70 | bad_user = self.users[1].copy() |
71 | 71 | bad_user['password'] = 'fooooooooooo wrong' |
@@ -117,17 +117,14 @@ def test_5_logout_success(self): |
117 | 117 | self.assertItemsEqual(('error', 'error_description'), tok_resp.json.keys()) |
118 | 118 | self.assertNotEqual(tok_resp.status_code, 200) |
119 | 119 |
|
120 | | - @classmethod |
121 | | - def assert_equal(cls, expect, got): |
122 | | - assert expect == got, "Expected: '{0}', got '{1}'".format(expect, got) |
123 | | - |
124 | 120 | @classmethod |
125 | 121 | def tearDownClass(cls): |
126 | 122 | unregister_resps = (cls.app.delete('/api/oauth2/unregister', params=cls.users[1]), |
127 | 123 | cls.app.delete('/api/oauth2/unregister', params=cls.users[2])) |
128 | 124 | for unregister_resp in unregister_resps: |
129 | | - cls.assert_equal(got=unregister_resp.content_type, expect=None) |
130 | | - cls.assert_equal(got=unregister_resp.status, expect="204 No Content") |
| 125 | + self = Test() |
| 126 | + self.assertEqual(got=unregister_resp.content_type, expect=None) |
| 127 | + self.assertEqual(got=unregister_resp.status, expect="204 No Content") |
131 | 128 |
|
132 | 129 |
|
133 | 130 | if __name__ == '__main__': |
|
0 commit comments