Skip to content

Commit fece3a3

Browse files
committed
test: add unit tests for organization property
1 parent f5b4e94 commit fece3a3

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

openedx_authz/tests/api/test_data.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,28 @@ def test_scope_content_lib_data_namespace(self, external_key):
9898

9999
self.assertEqual(scope.namespaced_key, expected)
100100

101+
@data(
102+
("lib:DemoX:CSPROB", "DemoX"),
103+
("lib:Org1:math_101", "Org1"),
104+
)
105+
@unpack
106+
def test_content_library_data_org_property(self, external_key, expected_org):
107+
"""Test that ContentLibraryData returns the correct organization name."""
108+
scope = ContentLibraryData(external_key=external_key)
109+
110+
self.assertEqual(scope.org, expected_org)
111+
112+
@data(
113+
("course-v1:DemoX+TestCourse+2024_T1", "DemoX"),
114+
("course-v1:WGU+CS002+2025_T1", "WGU"),
115+
)
116+
@unpack
117+
def test_course_overview_data_org_property(self, external_key, expected_org):
118+
"""Test that CourseOverviewData returns the correct organization name."""
119+
scope = CourseOverviewData(external_key=external_key)
120+
121+
self.assertEqual(scope.org, expected_org)
122+
101123

102124
@ddt
103125
class TestPolymorphicData(TestCase):

0 commit comments

Comments
 (0)