aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/tests/tests.py
diff options
context:
space:
mode:
authorJocelyn Delalande <jocelyn@crapouillou.net>2017-12-27 20:41:44 +0100
committer0livd <github@destras.fr>2017-12-27 23:27:41 +0100
commit40e5a833a17d932b45f018980d1c558ca5a68e26 (patch)
tree8d3a459fbad2ee47989c7786ca9b838047552524 /ihatemoney/tests/tests.py
parent8fdf6407eb9ef2c8a68d7d53469f2a835f46eb48 (diff)
downloadihatemoney-mirror-40e5a833a17d932b45f018980d1c558ca5a68e26.zip
ihatemoney-mirror-40e5a833a17d932b45f018980d1c558ca5a68e26.tar.gz
ihatemoney-mirror-40e5a833a17d932b45f018980d1c558ca5a68e26.tar.bz2
Fix tests layout so that API tests are not ran twice
Bad inheritance was causing APITestsCase tests to be ran twice.
Diffstat (limited to 'ihatemoney/tests/tests.py')
-rw-r--r--ihatemoney/tests/tests.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/ihatemoney/tests/tests.py b/ihatemoney/tests/tests.py
index b605889..25ca084 100644
--- a/ihatemoney/tests/tests.py
+++ b/ihatemoney/tests/tests.py
@@ -72,6 +72,10 @@ class IhatemoneyTestCase(BaseTestCase):
TESTING = True
WTF_CSRF_ENABLED = False # Simplifies the tests.
+ def assertStatus(self, expected, resp, url=""):
+ return self.assertEqual(expected, resp.status_code,
+ "%s expected %s, got %s" % (url, expected, resp.status_code))
+
class ConfigurationTestCase(BaseTestCase):
@@ -1009,11 +1013,6 @@ class APITestCase(IhatemoneyTestCase):
('%s:%s' % (username, password)).encode('utf-8')).decode('utf-8').replace('\n', '')
return {"Authorization": "Basic %s" % base64string}
- def assertStatus(self, expected, resp, url=""):
-
- return self.assertEqual(expected, resp.status_code,
- "%s expected %s, got %s" % (url, expected, resp.status_code))
-
def test_basic_auth(self):
# create a project
resp = self.api_create("raclette")
@@ -1370,7 +1369,7 @@ class APITestCase(IhatemoneyTestCase):
self.assertDictEqual(decoded_req, expected)
-class ServerTestCase(APITestCase):
+class ServerTestCase(IhatemoneyTestCase):
def test_unprefixed(self):
self.app.config['APPLICATION_ROOT'] = '/'