File tree Expand file tree Collapse file tree 5 files changed +36
-2
lines changed Expand file tree Collapse file tree 5 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 13
13
14
14
import os , random , string
15
15
from dotenv import load_dotenv
16
- from ms_identity_python .
django import Auth # pip install "ms_identity_python[django] @ git+https://github.com/azure-samples/[email protected] "
16
+ from identity .django import Auth
17
17
load_dotenv ()
18
18
AUTH = Auth (
19
19
os .getenv ('CLIENT_ID' ),
Original file line number Diff line number Diff line change 1
- ms_identity_python [django ] @ git+ https://github.com/azure-samples/ms-identity-python@0.8
1
+ ms_identity_python [django ] @ https://github.com/azure-samples/ms-identity-python/archive/refs/heads/0.9.zip
2
2
python-dotenv < 0.22
3
3
requests >= 2 ,< 3
Original file line number Diff line number Diff line change
1
+ from django .test import TestCase
2
+ from django .template .exceptions import TemplateDoesNotExist
3
+
4
+
5
+ class TemplateAccessibilityTest (TestCase ):
6
+ def test_login_attempt_should_render_its_template (self ):
7
+ try :
8
+ response = self .client .get ("/" ) # It will trigger the login attempt
9
+ print (response .content )
10
+ # The response could be rendered by login.html if .env is complete,
11
+ # or by auth_error.html otherwise.
12
+ # I haven't figured out how to mock the .env to test it decisively.
13
+ except TemplateDoesNotExist :
14
+ self .fail (
15
+ "Template should be accessible, "
16
+ "typically came from inside the Identity package." )
17
+
Original file line number Diff line number Diff line change
1
+ [tox]
2
+ env_list =
3
+ py3
4
+ minversion = 4.21.2
5
+
6
+ [testenv]
7
+ description = run the tests with pytest
8
+ package = wheel
9
+ wheel_build_env = .pkg
10
+ deps =
11
+ pytest>=6
12
+ -r requirements.txt
13
+ skip_install = true # To bypass the error "Multiple top-level packages discovered"
14
+ commands =
15
+ pip list
16
+ python manage.py test
17
+
You can’t perform that action at this time.
0 commit comments