-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed namespace issue with urls
so that reverse("platform_plugin_aspects:superset_guest_token") works whether we're in standalone tests or a plugin to the platform.
- Loading branch information
1 parent
d804eb0
commit 569f395
Showing
5 changed files
with
22 additions
and
38 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
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 |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
from django.contrib.auth import get_user_model | ||
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist | ||
from django.test import TestCase | ||
from django.urls import reverse | ||
from opaque_keys.edx.keys import CourseKey | ||
from rest_framework.test import APIClient | ||
|
||
|
@@ -29,10 +28,7 @@ def setUp(self): | |
""" | ||
super().setUp() | ||
self.client = APIClient() | ||
self.superset_guest_token_url = reverse( | ||
"superset_guest_token", | ||
kwargs={"course_id": COURSE_ID}, | ||
) | ||
self.superset_guest_token_url = f"/superset_guest_token/{COURSE_ID}" | ||
self.user = User.objects.create( | ||
username="user", | ||
email="[email protected]", | ||
|
@@ -50,10 +46,7 @@ def test_guest_token_requires_course_access(self): | |
self.assertEqual(response.status_code, 403) | ||
|
||
def test_guest_token_invalid_course_id(self): | ||
superset_guest_token_url = reverse( | ||
"superset_guest_token", | ||
kwargs={"course_id": "block-v1:org+course+run"}, | ||
) | ||
superset_guest_token_url = "/superset_guest_token/block-v1:org+course+run" | ||
self.client.login(username="user", password="password") | ||
response = self.client.post(superset_guest_token_url) | ||
self.assertEqual(response.status_code, 404) | ||
|
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