Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
hypha
Commits
776957e9
Commit
776957e9
authored
6 years ago
by
Todd Dembrey
Browse files
Options
Downloads
Patches
Plain Diff
Make sure we handle the test case using production settings
parent
3853c6f4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
opentech/apply/users/tests/test_views.py
+7
-6
7 additions, 6 deletions
opentech/apply/users/tests/test_views.py
with
7 additions
and
6 deletions
opentech/apply/users/tests/test_views.py
+
7
−
6
View file @
776957e9
...
@@ -17,20 +17,21 @@ class TestProfileView(BaseTestProfielView):
...
@@ -17,20 +17,21 @@ class TestProfileView(BaseTestProfielView):
def
test_cant_acces_if_not_logged_in
(
self
):
def
test_cant_acces_if_not_logged_in
(
self
):
self
.
client
.
logout
()
self
.
client
.
logout
()
response
=
self
.
client
.
get
(
self
.
url
)
response
=
self
.
client
.
get
(
self
.
url
,
follow
=
True
)
self
.
assertRedirects
(
response
,
reverse
(
'
users:login
'
)
+
'
?next=
'
+
self
.
url
)
# Initial redirect will be via to https through a 301
self
.
assertRedirects
(
response
,
reverse
(
'
users:login
'
)
+
'
?next=
'
+
self
.
url
,
status_code
=
301
)
def
test_includes_change_password
(
self
):
def
test_includes_change_password
(
self
):
response
=
self
.
client
.
get
(
self
.
url
)
response
=
self
.
client
.
get
(
self
.
url
,
follow
=
True
)
self
.
assertContains
(
response
,
reverse
(
'
users:password_change
'
))
self
.
assertContains
(
response
,
reverse
(
'
users:password_change
'
))
def
test_doesnt_includes_change_password_for_oauth
(
self
):
def
test_doesnt_includes_change_password_for_oauth
(
self
):
self
.
client
.
force_login
(
OAuthUserFactory
())
self
.
client
.
force_login
(
OAuthUserFactory
())
response
=
self
.
client
.
get
(
self
.
url
)
response
=
self
.
client
.
get
(
self
.
url
,
follow
=
True
)
self
.
assertNotContains
(
response
,
reverse
(
'
users:password_change
'
))
self
.
assertNotContains
(
response
,
reverse
(
'
users:password_change
'
))
def
test_cant_set_slack_name
(
self
):
def
test_cant_set_slack_name
(
self
):
response
=
self
.
client
.
get
(
self
.
url
)
response
=
self
.
client
.
get
(
self
.
url
,
follow
=
True
)
self
.
assertNotContains
(
response
,
'
Slack name
'
)
self
.
assertNotContains
(
response
,
'
Slack name
'
)
...
@@ -40,5 +41,5 @@ class TestStaffProfileView(BaseTestProfielView):
...
@@ -40,5 +41,5 @@ class TestStaffProfileView(BaseTestProfielView):
self
.
client
.
force_login
(
self
.
staff
)
self
.
client
.
force_login
(
self
.
staff
)
def
test_can_set_slack_name
(
self
):
def
test_can_set_slack_name
(
self
):
response
=
self
.
client
.
get
(
self
.
url
)
response
=
self
.
client
.
get
(
self
.
url
,
follow
=
True
)
self
.
assertContains
(
response
,
'
Slack name
'
)
self
.
assertContains
(
response
,
'
Slack name
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment