From 34201b928d5e148267bf02d94c4bd828c19599cd Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 13 Jun 2021 21:02:13 +0200 Subject: [PATCH] add follow redirect and delete first database init release --- tests/testBase.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/testBase.py b/tests/testBase.py index 83b2c6f..d3eb98f 100644 --- a/tests/testBase.py +++ b/tests/testBase.py @@ -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