File: import_test_without_django.py

package info (click to toggle)
django-auth-ldap 5.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 464 kB
  • sloc: python: 2,599; makefile: 23; sh: 12
file content (16 lines) | stat: -rw-r--r-- 361 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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