From 47b325896d69646ed314cd2d2a52f45df3324d1b Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Wed, 26 Jun 2019 13:34:54 -0400 Subject: [PATCH] Remove the django_db mark from TransactionTestCase classes pytest-django's documentation indicates that it isn't necessary, and it turns out in Django 2.0+ that this double application of the transaction machinations was causing the Django ContentType table to lose its items. --- awx/main/tests/functional/models/test_workflow.py | 1 - awx/main/tests/functional/task_management/test_capacity.py | 1 - awx/main/tests/functional/test_rbac_user.py | 1 - 3 files changed, 3 deletions(-) diff --git a/awx/main/tests/functional/models/test_workflow.py b/awx/main/tests/functional/models/test_workflow.py index 3b61e6c29b..cc4c42ecfe 100644 --- a/awx/main/tests/functional/models/test_workflow.py +++ b/awx/main/tests/functional/models/test_workflow.py @@ -20,7 +20,6 @@ from django.test import TransactionTestCase from django.core.exceptions import ValidationError -@pytest.mark.django_db class TestWorkflowDAGFunctional(TransactionTestCase): def workflow_job(self, states=['new', 'new', 'new', 'new', 'new']): """ diff --git a/awx/main/tests/functional/task_management/test_capacity.py b/awx/main/tests/functional/task_management/test_capacity.py index 7b7b7d7dc0..4bcb63507c 100644 --- a/awx/main/tests/functional/task_management/test_capacity.py +++ b/awx/main/tests/functional/task_management/test_capacity.py @@ -8,7 +8,6 @@ from awx.main.models import ( ) -@pytest.mark.django_db class TestCapacityMapping(TransactionTestCase): def sample_cluster(self): diff --git a/awx/main/tests/functional/test_rbac_user.py b/awx/main/tests/functional/test_rbac_user.py index 403767749f..c161a79c2f 100644 --- a/awx/main/tests/functional/test_rbac_user.py +++ b/awx/main/tests/functional/test_rbac_user.py @@ -7,7 +7,6 @@ from awx.main.access import UserAccess, RoleAccess, TeamAccess from awx.main.models import User, Organization, Inventory -@pytest.mark.django_db class TestSysAuditorTransactional(TransactionTestCase): def rando(self): return User.objects.create(username='rando', password='rando', email='rando@com.com')