add follow redirect and delete first database init release
This commit is contained in:
parent
d89c2591c5
commit
34201b928d
@ -12,8 +12,6 @@ class TestBase(unittest.TestCase):
|
||||
self.config = DefaultConfig()
|
||||
self.config.BASE["database_uri"] = "sqlite:///" + self.__db[1]
|
||||
self.config.TESTING = True
|
||||
init_database(self.config.BASE["database_uri"])
|
||||
release_database()
|
||||
self.__app = create_app(self.config)
|
||||
self.client = self.__app.test_client()
|
||||
|
||||
@ -34,8 +32,8 @@ class APITestBase(TestBase):
|
||||
if not isinstance(args, dict):
|
||||
raise TypeError("'args', expecting a dict, got " + type(args).__name__)
|
||||
uri = "/api/v1/{}".format(endpoint)
|
||||
|
||||
method = getattr(self.client, method)
|
||||
rv = method(uri, data=args)
|
||||
rv = method(uri, data=args, follow_redirects=True)
|
||||
print(rv.data)
|
||||
self.assertEqual(rv.status_code, return_code)
|
||||
return rv
|
||||
|
Loading…
Reference in New Issue
Block a user