diff --git a/example_project/portal_test_settings.py b/example_project/portal_test_settings.py index 9694f2036..38e232184 100644 --- a/example_project/portal_test_settings.py +++ b/example_project/portal_test_settings.py @@ -60,6 +60,7 @@ "NAME": os.path.join( os.path.abspath(os.path.dirname(__file__)), "db.sqlite3" ), # Or path to database file if using sqlite3. + "ATOMIC_REQUESTS": True, } } diff --git a/example_project/settings.py b/example_project/settings.py index 1b037b461..a088cc625 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -11,6 +11,7 @@ "NAME": os.path.join( os.path.abspath(os.path.dirname(__file__)), "db.sqlite3" ), # Or path to database file if using sqlite3. + "ATOMIC_REQUESTS": True, } } diff --git a/portal/tests/test_emails.py b/portal/tests/test_emails.py index 2ae890366..b48f5f2a9 100644 --- a/portal/tests/test_emails.py +++ b/portal/tests/test_emails.py @@ -59,6 +59,7 @@ def test_newsletter_calls_correct_requests(mocker, monkeypatch): mocked_add_to_address_book.assert_called_once() +@pytest.mark.django_db def test_newsletter_get_not_allowed(): c = Client()