mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-29 17:52:37 +02:00
Fix tests layout so that API tests are not ran twice
Bad inheritance was causing APITestsCase tests to be ran twice.
This commit is contained in:
parent
8fdf6407eb
commit
40e5a833a1
1 changed files with 5 additions and 6 deletions
|
@ -72,6 +72,10 @@ class IhatemoneyTestCase(BaseTestCase):
|
||||||
TESTING = True
|
TESTING = True
|
||||||
WTF_CSRF_ENABLED = False # Simplifies the tests.
|
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):
|
class ConfigurationTestCase(BaseTestCase):
|
||||||
|
|
||||||
|
@ -1009,11 +1013,6 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
('%s:%s' % (username, password)).encode('utf-8')).decode('utf-8').replace('\n', '')
|
('%s:%s' % (username, password)).encode('utf-8')).decode('utf-8').replace('\n', '')
|
||||||
return {"Authorization": "Basic %s" % base64string}
|
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):
|
def test_basic_auth(self):
|
||||||
# create a project
|
# create a project
|
||||||
resp = self.api_create("raclette")
|
resp = self.api_create("raclette")
|
||||||
|
@ -1370,7 +1369,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
self.assertDictEqual(decoded_req, expected)
|
self.assertDictEqual(decoded_req, expected)
|
||||||
|
|
||||||
|
|
||||||
class ServerTestCase(APITestCase):
|
class ServerTestCase(IhatemoneyTestCase):
|
||||||
|
|
||||||
def test_unprefixed(self):
|
def test_unprefixed(self):
|
||||||
self.app.config['APPLICATION_ROOT'] = '/'
|
self.app.config['APPLICATION_ROOT'] = '/'
|
||||||
|
|
Loading…
Reference in a new issue