Skip to content

Commit 3f39b51

Browse files
committed
Create conftest.py and enable_db_access_for_all_tests fixture
1 parent d19ff95 commit 3f39b51

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

app/payment/tests/test_model_transaction.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_get_checkout_url(self):
2929
def assert_field_in(self, field_name, model):
3030
self.assertIn(field_name, get_all_field_names(model))
3131

32-
@pytest.mark.django_db
32+
3333
class TransactionTestCase(TestCase):
3434

3535
def test_should_upgrade_last_payment(self):

conftest.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pytest
2+
from django.db import connections
3+
4+
5+
6+
@pytest.fixture(autouse=True)
7+
def enable_db_access_for_all_tests(db):
8+
pass

pytest.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[pytest]
22
DJANGO_SETTINGS_MODULE = associados.settings_test
33
python_files = tests.py test_*.py *_tests.py
4-
addopts = -p no:warnings --spec
4+
addopts = -p no:warnings --spec --create-db

0 commit comments

Comments
 (0)