Skip to content

Commit

Permalink
Release 1.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
albertoleoncio committed Jul 22, 2024
2 parents d247d40 + 546ee89 commit d311cfa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions orgs/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ def setUp(self):
Territory.objects.create(territory_name='Territory 1')

def test_list_orgs_unauthenticated(self):
response = self.client.get('/list_organizations/')
response = self.client.get('/list_affiliation/')
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)

def test_list_orgs_authenticated(self):
self.client.force_authenticate(self.user)
response = self.client.get('/list_organizations/')
response = self.client.get('/list_affiliation/')
self.assertEqual(response.status_code, status.HTTP_200_OK)

organization = Organization.objects.create(
Expand All @@ -188,7 +188,7 @@ def test_list_orgs_authenticated(self):
type=OrganizationType.objects.get(pk=1),
)
organization.territory.set([Territory.objects.get(pk=1)])
response = self.client.get('/list_organizations/')
response = self.client.get('/list_affiliation/')
self.assertEqual(len(response.data), 1)
expected = {
1: 'New Organization (NO)',
Expand All @@ -202,7 +202,7 @@ def test_list_orgs_authenticated(self):
)
organization.territory.set([Territory.objects.get(pk=1)])
organization.managers.set([self.user])
response = self.client.get('/list_organizations/')
response = self.client.get('/list_affiliation/')
self.assertEqual(len(response.data), 2)
expected = {
1: 'New Organization (NO)',
Expand All @@ -213,7 +213,7 @@ def test_list_orgs_authenticated(self):
def test_list_orgs_staff(self):
self.user.is_staff = True
self.client.force_authenticate(self.user)
response = self.client.get('/list_organizations/')
response = self.client.get('/list_affiliation/')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(len(response.data), 0)

Expand All @@ -224,5 +224,5 @@ def test_list_orgs_staff(self):
'territory': '1',
}
self.client.post('/organizations/', org_data)
response = self.client.get('/list_organizations/')
self.assertEqual(len(response.data), 1)
response = self.client.get('/list_affiliation/')
self.assertEqual(len(response.data), 1)
2 changes: 1 addition & 1 deletion users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def retrieve(self, request, *args, **kwargs):
'wanted': [{'id': user.id, 'display_name': user.display_name, 'username': user.user.username, 'profile_image': user.profile_image} for user in wanted_users],
}
elif tag_type == 'language':
users = Profile.objects.filter(languages=tag_id)
users = Profile.objects.filter(language=tag_id)
data = [{'id': user.id, 'display_name': user.display_name, 'username': user.user.username, 'profile_image': user.profile_image} for user in users]
elif tag_type == 'territory':
users = Profile.objects.filter(territory=tag_id)
Expand Down

0 comments on commit d311cfa

Please sign in to comment.