Skip to content

Commit

Permalink
Do django.setup() when running django unit-tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Apr 14, 2024
1 parent c8aa791 commit 530ac84
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,11 @@ def run_tests(self, handle_coverage=True):
sys.stdout.write("done.\n")
sys.stdout.write("Importing test modules ... ")

if self.configuration.django:
import django
if hasattr(django, 'setup'):
django.setup()

if handle_coverage:
coverage_files, coverage = start_coverage_support(self.configuration)

Expand Down

0 comments on commit 530ac84

Please sign in to comment.