Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
83c91e24
Commit
83c91e24
authored
Aug 24, 2015
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert Shib external auth test to use SharedModuleStoreTestCase.
parent
08343b96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
common/djangoapps/external_auth/tests/test_shib.py
+6
-3
No files found.
common/djangoapps/external_auth/tests/test_shib.py
View file @
83c91e24
...
@@ -26,7 +26,7 @@ from student.views import create_account, change_enrollment
...
@@ -26,7 +26,7 @@ from student.views import create_account, change_enrollment
from
student.models
import
UserProfile
,
CourseEnrollment
from
student.models
import
UserProfile
,
CourseEnrollment
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
Shared
ModuleStoreTestCase
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore
import
ModuleStoreEnum
...
@@ -74,7 +74,7 @@ def gen_all_identities():
...
@@ -74,7 +74,7 @@ def gen_all_identities():
@ddt
@ddt
@override_settings
(
SESSION_ENGINE
=
'django.contrib.sessions.backends.cache'
)
@override_settings
(
SESSION_ENGINE
=
'django.contrib.sessions.backends.cache'
)
class
ShibSPTest
(
ModuleStoreTestCase
):
class
ShibSPTest
(
Shared
ModuleStoreTestCase
):
"""
"""
Tests for the Shibboleth SP, which communicates via request.META
Tests for the Shibboleth SP, which communicates via request.META
(Apache environment variables set by mod_shib)
(Apache environment variables set by mod_shib)
...
@@ -82,7 +82,7 @@ class ShibSPTest(ModuleStoreTestCase):
...
@@ -82,7 +82,7 @@ class ShibSPTest(ModuleStoreTestCase):
request_factory
=
RequestFactory
()
request_factory
=
RequestFactory
()
def
setUp
(
self
):
def
setUp
(
self
):
super
(
ShibSPTest
,
self
)
.
setUp
(
create_user
=
False
)
super
(
ShibSPTest
,
self
)
.
setUp
()
self
.
test_user_id
=
ModuleStoreEnum
.
UserID
.
test
self
.
test_user_id
=
ModuleStoreEnum
.
UserID
.
test
@unittest.skipUnless
(
settings
.
FEATURES
.
get
(
'AUTH_USE_SHIB'
),
"AUTH_USE_SHIB not set"
)
@unittest.skipUnless
(
settings
.
FEATURES
.
get
(
'AUTH_USE_SHIB'
),
"AUTH_USE_SHIB not set"
)
...
@@ -376,6 +376,7 @@ class ShibSPTest(ModuleStoreTestCase):
...
@@ -376,6 +376,7 @@ class ShibSPTest(ModuleStoreTestCase):
self
.
assertEqual
(
profile
.
name
,
identity
.
get
(
'displayName'
)
.
decode
(
'utf-8'
))
self
.
assertEqual
(
profile
.
name
,
identity
.
get
(
'displayName'
)
.
decode
(
'utf-8'
))
@unittest.skipUnless
(
settings
.
FEATURES
.
get
(
'AUTH_USE_SHIB'
),
"AUTH_USE_SHIB not set"
)
@unittest.skipUnless
(
settings
.
FEATURES
.
get
(
'AUTH_USE_SHIB'
),
"AUTH_USE_SHIB not set"
)
@SharedModuleStoreTestCase.modifies_courseware
@data
(
None
,
""
,
"shib:https://idp.stanford.edu/"
)
@data
(
None
,
""
,
"shib:https://idp.stanford.edu/"
)
def
test_course_specific_login_and_reg
(
self
,
domain
):
def
test_course_specific_login_and_reg
(
self
,
domain
):
"""
"""
...
@@ -454,6 +455,7 @@ class ShibSPTest(ModuleStoreTestCase):
...
@@ -454,6 +455,7 @@ class ShibSPTest(ModuleStoreTestCase):
'&enrollment_action=enroll'
)
'&enrollment_action=enroll'
)
@unittest.skipUnless
(
settings
.
FEATURES
.
get
(
'AUTH_USE_SHIB'
),
"AUTH_USE_SHIB not set"
)
@unittest.skipUnless
(
settings
.
FEATURES
.
get
(
'AUTH_USE_SHIB'
),
"AUTH_USE_SHIB not set"
)
@SharedModuleStoreTestCase.modifies_courseware
def
test_enrollment_limit_by_domain
(
self
):
def
test_enrollment_limit_by_domain
(
self
):
"""
"""
Tests that the enrollmentDomain setting is properly limiting enrollment to those who have
Tests that the enrollmentDomain setting is properly limiting enrollment to those who have
...
@@ -521,6 +523,7 @@ class ShibSPTest(ModuleStoreTestCase):
...
@@ -521,6 +523,7 @@ class ShibSPTest(ModuleStoreTestCase):
self
.
assertFalse
(
CourseEnrollment
.
is_enrolled
(
student
,
course
.
id
))
self
.
assertFalse
(
CourseEnrollment
.
is_enrolled
(
student
,
course
.
id
))
@unittest.skipUnless
(
settings
.
FEATURES
.
get
(
'AUTH_USE_SHIB'
),
"AUTH_USE_SHIB not set"
)
@unittest.skipUnless
(
settings
.
FEATURES
.
get
(
'AUTH_USE_SHIB'
),
"AUTH_USE_SHIB not set"
)
@SharedModuleStoreTestCase.modifies_courseware
def
test_shib_login_enrollment
(
self
):
def
test_shib_login_enrollment
(
self
):
"""
"""
A functionality test that a student with an existing shib login
A functionality test that a student with an existing shib login
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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