-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow importing the backend without loading apps
Make it possible to monkey-patch the backend from the settings.
- Loading branch information
1 parent
1966c9e
commit 943c800
Showing
3 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import os | ||
from unittest import TestCase | ||
|
||
|
||
class TestLoading(TestCase): | ||
def test_django_not_ready(self): | ||
orig_env = os.environ.copy() | ||
|
||
def reset_env(): | ||
os.environ = orig_env | ||
|
||
self.addCleanup(reset_env) | ||
|
||
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings" | ||
|
||
import django_auth_ldap.backend # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters