Skip to content

Commit

Permalink
Move self.extra assignment to setUp function
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankApiyo committed Aug 14, 2024
1 parent 8c89a96 commit d3f7bd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions onadata/apps/api/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ 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}

def test_user_added_to_org(self, mock_add):
"""User is added to organization"""
self.extra = {"HTTP_AUTHORIZATION": "Token %s" % self.user.auth_token}
request = self.factory.get("/", **self.extra)
request.user = self.user
set_cache_for_org(self.org, request)
Expand Down Expand Up @@ -241,10 +241,10 @@ 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}

def test_user_removed_from_org(self, mock_remove):
"""User is removed from organization"""
self.extra = {"HTTP_AUTHORIZATION": "Token %s" % self.user.auth_token}
request = self.factory.get("/", **self.extra)
request.user = self.user
set_cache_for_org(self.org, request)
Expand Down

0 comments on commit d3f7bd7

Please sign in to comment.