Skip to content

Commit

Permalink
Clean-up: Add docstring and reformat token string
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankApiyo committed Aug 14, 2024
1 parent d3f7bd7 commit cebcded
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions onadata/apps/api/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def mock_get_full_dict(
self.assertFalse(instance.json)

def set_cache_for_org(org, request):
"""Utility to set org cache"""
org_profile_json = OrganizationSerializer(
org, context={"request": request}
).data
Expand All @@ -140,7 +141,7 @@ def setUp(self):
self.org = OrganizationProfile.objects.create(
user=self.org_user, name="Ona Org", creator=alice
)
self.extra = {"HTTP_AUTHORIZATION": "Token %s" % self.user.auth_token}
self.extra = {"HTTP_AUTHORIZATION": f"Token {self.user.auth_token}"}

def test_user_added_to_org(self, mock_add):
"""User is added to organization"""
Expand Down Expand Up @@ -241,7 +242,7 @@ def setUp(self):
self.org = OrganizationProfile.objects.create(
user=self.org_user, name="Ona Org", creator=alice
)
self.extra = {"HTTP_AUTHORIZATION": "Token %s" % self.user.auth_token}
self.extra = {"HTTP_AUTHORIZATION": f"Token {self.user.auth_token}"}

def test_user_removed_from_org(self, mock_remove):
"""User is removed from organization"""
Expand Down

0 comments on commit cebcded

Please sign in to comment.