Skip to content

Commit

Permalink
refactor(test): oops, this function looked like a test, but is not
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Dec 4, 2022
1 parent 739306f commit 68c7408
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from django_coverage_plugin.plugin import DjangoTemplatePlugin


def test_settings():
def get_test_settings():
"""Create a dict full of default Django settings for the tests."""
the_settings = {
'CACHES': {
Expand Down Expand Up @@ -56,7 +56,7 @@ def test_settings():
return the_settings


settings.configure(**test_settings())
settings.configure(**get_test_settings())

if hasattr(django, "setup"):
django.setup()
Expand Down
8 changes: 4 additions & 4 deletions tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

from django.test.utils import override_settings

from .plugin_test import DjangoPluginTestCase, test_settings
from .plugin_test import DjangoPluginTestCase, get_test_settings

# Make settings overrides for tests below.
NON_DJANGO_BACKEND = 'django.template.backends.dummy.TemplateStrings'

DEBUG_FALSE_OVERRIDES = test_settings()
DEBUG_FALSE_OVERRIDES = get_test_settings()
DEBUG_FALSE_OVERRIDES['TEMPLATES'][0]['OPTIONS']['debug'] = False

NO_OPTIONS_OVERRIDES = test_settings()
NO_OPTIONS_OVERRIDES = get_test_settings()
del NO_OPTIONS_OVERRIDES['TEMPLATES'][0]['OPTIONS']

OTHER_ENGINE_OVERRIDES = test_settings()
OTHER_ENGINE_OVERRIDES = get_test_settings()
OTHER_ENGINE_OVERRIDES['TEMPLATES'][0]['BACKEND'] = NON_DJANGO_BACKEND
OTHER_ENGINE_OVERRIDES['TEMPLATES'][0]['OPTIONS'] = {}

Expand Down

0 comments on commit 68c7408

Please sign in to comment.