Skip to content

Commit

Permalink
Remove sys.path manipulation from tests
Browse files Browse the repository at this point in the history
It was allowing the model to be imported twice and fail in the model registry since it would be registered to two different apps.
  • Loading branch information
adamchainz committed Jan 7, 2017
1 parent cb43168 commit 1ab3609
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@


def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
sys.path.insert(0, 'tests')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings')
return pytest.main()


Expand Down
4 changes: 2 additions & 2 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

INSTALLED_APPS = [
'corsheaders',
'testapp',
'tests.testapp',
]

DATABASES = {
Expand All @@ -15,7 +15,7 @@
},
}

ROOT_URLCONF = 'urls'
ROOT_URLCONF = 'tests.urls'


middlewares = list(global_settings.MIDDLEWARE_CLASSES)
Expand Down

0 comments on commit 1ab3609

Please sign in to comment.