From 73137d0858c47190fb3540f5b0b48755f0b38f5b Mon Sep 17 00:00:00 2001 From: Dan Funk Date: Sun, 31 May 2020 17:18:07 -0400 Subject: [PATCH] If an assertion fails, the tests stop at that point, never reaching the last line in the test. You have to handle any tear down, in the tearDown method. --- tests/test_authentication.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_authentication.py b/tests/test_authentication.py index db0d25df..bdad776a 100644 --- a/tests/test_authentication.py +++ b/tests/test_authentication.py @@ -1,15 +1,20 @@ import json from datetime import timezone, datetime +from tests.base_test import BaseTest from crc import db, app from crc.models.study import StudySchema from crc.models.user import UserModel -from models.protocol_builder import ProtocolBuilderStatus -from tests.base_test import BaseTest +from crc.models.protocol_builder import ProtocolBuilderStatus class TestAuthentication(BaseTest): + def tearDown(self): + # Assure we set the production flag back to false. + app.config['PRODUCTION'] = False + super().tearDown() + def test_auth_token(self): self.load_example_data() user = UserModel(uid="dhf8r")