Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Hsin-Yu Chien
edx-platform-release
Commits
7c211a58
Commit
7c211a58
authored
5 years ago
by
Nimisha Asthagiri
Browse files
Options
Downloads
Patches
Plain Diff
api_admin python-3 upgrade
parent
50cd2ec4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/api_admin/tests/test_views.py
+8
-14
8 additions, 14 deletions
openedx/core/djangoapps/api_admin/tests/test_views.py
with
8 additions
and
14 deletions
openedx/core/djangoapps/api_admin/tests/test_views.py
+
8
−
14
View file @
7c211a58
...
...
@@ -138,8 +138,7 @@ class ApiRequestStatusViewTest(ApiAdminTest):
"""
ApiAccessRequestFactory
(
user
=
self
.
user
,
status
=
status
)
response
=
self
.
client
.
get
(
self
.
url
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertIn
(
expected
,
response
.
content
)
self
.
assertContains
(
response
,
expected
)
def
test_get_with_existing_application
(
self
):
"""
...
...
@@ -149,11 +148,9 @@ class ApiRequestStatusViewTest(ApiAdminTest):
ApiAccessRequestFactory
(
user
=
self
.
user
,
status
=
ApiAccessRequest
.
APPROVED
)
application
=
ApplicationFactory
(
user
=
self
.
user
)
response
=
self
.
client
.
get
(
self
.
url
)
self
.
assertEqual
(
response
.
status_code
,
200
)
unicode_content
=
response
.
content
.
decode
(
'
utf-8
'
)
self
.
assertIn
(
application
.
client_secret
,
unicode_content
)
self
.
assertIn
(
application
.
client_id
,
unicode_content
)
self
.
assertIn
(
application
.
redirect_uris
,
unicode_content
)
self
.
assertContains
(
response
,
application
.
client_secret
)
self
.
assertContains
(
response
,
application
.
client_id
)
self
.
assertContains
(
response
,
application
.
redirect_uris
)
def
test_get_anonymous
(
self
):
"""
Verify that users must be logged in to see the page.
"""
...
...
@@ -208,7 +205,7 @@ class ApiRequestStatusViewTest(ApiAdminTest):
'
name
'
:
'
test.com
'
,
'
redirect_uris
'
:
'
not a url
'
})
self
.
assert
In
(
'
Enter a valid URL.
'
,
response
.
content
)
self
.
assert
Contains
(
response
,
'
Enter a valid URL.
'
)
@skip_unless_lms
...
...
@@ -222,8 +219,7 @@ class ApiTosViewTest(ApiAdminTest):
"""
url
=
reverse
(
'
api_admin:api-tos
'
)
response
=
self
.
client
.
get
(
url
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertIn
(
'
Terms of Service
'
,
response
.
content
)
self
.
assertContains
(
response
,
'
Terms of Service
'
)
class
CatalogTest
(
ApiAdminTest
):
...
...
@@ -293,8 +289,7 @@ class CatalogListViewTest(CatalogTest):
catalog
=
CatalogFactory
(
viewers
=
[
self
.
catalog_user
.
username
])
self
.
mock_catalog_endpoint
({
'
results
'
:
[
catalog
.
attributes
]})
response
=
self
.
client
.
get
(
self
.
url
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertIn
(
catalog
.
name
,
response
.
content
.
decode
(
'
utf-8
'
))
self
.
assertContains
(
response
,
catalog
.
name
)
@httpretty.activate
def
test_get_no_catalogs
(
self
):
...
...
@@ -346,8 +341,7 @@ class CatalogEditViewTest(CatalogTest):
def
test_get
(
self
):
self
.
mock_catalog_endpoint
(
self
.
catalog
.
attributes
,
catalog_id
=
self
.
catalog
.
id
)
response
=
self
.
client
.
get
(
self
.
url
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertIn
(
self
.
catalog
.
name
,
response
.
content
.
decode
(
'
utf-8
'
))
self
.
assertContains
(
response
,
self
.
catalog
.
name
)
@httpretty.activate
def
test_delete
(
self
):
...
...
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