-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2734 from carpentries/feature/2260-allow-admins-t…
…o-see-upcoming-teaching-opportunities Allow admins to see upcoming teaching opportunities
- Loading branch information
Showing
5 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,19 @@ def test_view_enabled__community_role_active(self): | |
self.assertEqual(role.is_active(), True) | ||
self.assertEqual(view.get_view_enabled(request), True) | ||
|
||
@override_settings(FLAGS={"INSTRUCTOR_RECRUITMENT": [("boolean", True)]}) | ||
def test_view_enabled__admin(self): | ||
# Arrange | ||
request = RequestFactory().get("/") | ||
person = Person.objects.create( | ||
personal="Test", family="User", email="[email protected]", is_superuser=True | ||
) | ||
request.user = person | ||
# Act | ||
view = UpcomingTeachingOpportunitiesList(request=request) | ||
# Assert | ||
self.assertEqual(view.get_view_enabled(request), True) | ||
|
||
def test_get_queryset(self): | ||
# Arrange | ||
host = Organization.objects.create(domain="test.com", fullname="Test") | ||
|
@@ -265,6 +278,19 @@ def test_view_enabled__community_role_active(self): | |
self.assertEqual(role.is_active(), True) | ||
self.assertEqual(view.get_view_enabled(request), True) | ||
|
||
@override_settings(FLAGS={"INSTRUCTOR_RECRUITMENT": [("boolean", True)]}) | ||
def test_view_enabled__admin(self): | ||
# Arrange | ||
request = RequestFactory().get("/") | ||
person = Person.objects.create( | ||
personal="Test", family="User", email="[email protected]", is_superuser=True | ||
) | ||
request.user = person | ||
# Act | ||
view = SignupForRecruitment(request=request) | ||
# Assert | ||
self.assertEqual(view.get_view_enabled(request), True) | ||
|
||
def test_get_context_data(self): | ||
# Arrange | ||
host = Organization.objects.create(domain="test.com", fullname="Test") | ||
|
@@ -581,6 +607,19 @@ def test_view_enabled__community_role_active(self): | |
self.assertEqual(role.is_active(), True) | ||
self.assertEqual(view.get_view_enabled(request), True) | ||
|
||
@override_settings(FLAGS={"INSTRUCTOR_RECRUITMENT": [("boolean", True)]}) | ||
def test_view_enabled__admin(self): | ||
# Arrange | ||
request = RequestFactory().get("/") | ||
person = Person.objects.create( | ||
personal="Test", family="User", email="[email protected]", is_superuser=True | ||
) | ||
request.user = person | ||
# Act | ||
view = ResignFromRecruitment(request=request) | ||
# Assert | ||
self.assertEqual(view.get_view_enabled(request), True) | ||
|
||
def test_get_queryset(self): | ||
# Arrange | ||
host = Organization.objects.create(domain="test.com", fullname="Test") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters