Skip to content

Commit

Permalink
Adding missing test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Jan 23, 2024
1 parent f73643f commit d0162df
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
15 changes: 15 additions & 0 deletions core/integration_tests/tests_concepts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,21 @@ def test_get_200_for_source_version(self): # pylint: disable=too-many-statement
])
)

response = self.client.get(
concept1.uri + '$cascade/?includeSelf=false&includeRetired=true&omitIfExistsIn=' + collection.uri
)

self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data['entry']), 3)
self.assertEqual(
sorted([data['url'] for data in response.data['entry']]),
sorted([
concept1.uri,
mapping1.uri,
mapping4.uri,
])
)

def test_get_200_for_collection_version(self): # pylint: disable=too-many-locals,too-many-statements
source1 = OrganizationSourceFactory()
source2 = OrganizationSourceFactory()
Expand Down
6 changes: 6 additions & 0 deletions core/integration_tests/tests_url_registries.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ def test_get(self):
self.assertEqual(response.data[0]['name'], 'org')
self.assertEqual(response.data[0]['id'], org_registry.id)

response = self.client.get(
'/users/foobar/orgs/url-registry/',
HTTP_AUTHORIZATION=f"Token {user_registry.user.get_token()}",
)
self.assertEqual(response.status_code, 404)


class URLRegistryViewTest(OCLAPITestCase):
def test_get(self):
Expand Down
3 changes: 0 additions & 3 deletions core/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ def is_valid_auth_group(*names):
def auth_groups(self):
return self.groups.values_list('name', flat=True)

def has_auth_group(self, group_name):
return self.groups.filter(name=group_name).exists()

@property
def auth_headers(self):
return {'Authorization': f'Token {self.get_token()}'}
Expand Down

0 comments on commit d0162df

Please sign in to comment.