Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mattia Rizzolo
nm.debian.org
Commits
0074cc8d
Commit
0074cc8d
authored
Apr 21, 2020
by
Enrico Zini
Browse files
Reproduced in test suite. refs:
#4
parent
3731aa30
Changes
2
Hide whitespace changes
Inline
Side-by-side
wizard/tests/test_advocate.py
View file @
0074cc8d
...
@@ -5,7 +5,7 @@ from backend import const
...
@@ -5,7 +5,7 @@ from backend import const
from
backend.unittest
import
PersonFixtureMixin
from
backend.unittest
import
PersonFixtureMixin
class
PersonPag
eTest
Case
(
PersonFixtureMixin
,
TestCase
):
class
Advocat
eTest
s
(
PersonFixtureMixin
,
TestCase
):
@
classmethod
@
classmethod
def
setUpClass
(
cls
):
def
setUpClass
(
cls
):
super
().
setUpClass
()
super
().
setUpClass
()
...
...
wizard/tests/test_whoami.py
0 → 100644
View file @
0074cc8d
from
__future__
import
annotations
from
django.test
import
TestCase
from
django.urls
import
reverse
from
backend
import
const
from
backend.unittest
import
PersonFixtureMixin
from
signon.models
import
Identity
class
WhoamiTests
(
PersonFixtureMixin
,
TestCase
):
def
test_notlogged
(
self
):
# Check that the new person is listed on the page
client
=
self
.
make_test_client
(
None
)
response
=
client
.
get
(
reverse
(
'wizard_home'
))
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertContains
(
response
,
"You are not currently logged in."
)
self
.
assertNotContains
(
response
,
"but not mapped to any person in the site."
)
self
.
assertNotContains
(
response
,
"You are currently logged in, and recognized as"
)
def
test_active_unbound
(
self
):
# Check that the new person is listed on the page
identity
=
Identity
.
objects
.
create
(
issuer
=
"debsso"
,
subject
=
"test@debian.org"
,
username
=
"test@debian.org"
,
audit_skip
=
True
)
client
=
self
.
make_test_client
(
None
,
[
identity
])
response
=
client
.
get
(
reverse
(
'wizard_home'
))
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertNotContains
(
response
,
"You are not currently logged in."
)
self
.
assertContains
(
response
,
"but not mapped to any person in the site."
)
self
.
assertNotContains
(
response
,
"You are currently logged in, and recognized as"
)
def
test_active_bound
(
self
):
# Check that the new person is listed on the page
identity
=
Identity
.
objects
.
create
(
person
=
self
.
persons
.
dc
,
issuer
=
"debsso"
,
subject
=
"test@debian.org"
,
username
=
"test@debian.org"
,
audit_skip
=
True
)
client
=
self
.
make_test_client
(
self
.
persons
.
dc
,
[
identity
])
response
=
client
.
get
(
reverse
(
'wizard_home'
))
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertNotContains
(
response
,
"You are not currently logged in."
)
self
.
assertNotContains
(
response
,
"but not mapped to any person in the site."
)
self
.
assertContains
(
response
,
"You are currently logged in, and recognized as"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment