Skip to content

Commit

Permalink
Merge pull request #5779 from nyaruka/remove_viewers_pt3
Browse files Browse the repository at this point in the history
Cleanup in campaigns app
  • Loading branch information
rowanseymour authored Jan 14, 2025
2 parents 47866ca + 3c75cf7 commit 518a8cc
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 572 deletions.
6 changes: 3 additions & 3 deletions temba/api/v2/tests/test_campaign_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def test_endpoint(self, mr_mocks):
endpoint_url = reverse("api.v2.campaign_events") + ".json"

self.assertGetNotPermitted(endpoint_url, [None, self.agent])
self.assertPostNotPermitted(endpoint_url, [None, self.user, self.agent])
self.assertDeleteNotPermitted(endpoint_url, [None, self.user, self.agent])
self.assertPostNotPermitted(endpoint_url, [None, self.agent])
self.assertDeleteNotPermitted(endpoint_url, [None, self.agent])

joe = self.create_contact("Joe Blow", phone="+250788123123")
frank = self.create_contact("Frank", urns=["facebook:123456"])
Expand Down Expand Up @@ -63,7 +63,7 @@ def test_endpoint(self, mr_mocks):
# no filtering
self.assertGet(
endpoint_url,
[self.user, self.editor, self.admin],
[self.editor, self.admin],
results=[
{
"uuid": str(event3.uuid),
Expand Down
4 changes: 2 additions & 2 deletions temba/api/v2/tests/test_campaigns.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_endpoint(self):
endpoint_url = reverse("api.v2.campaigns") + ".json"

self.assertGetNotPermitted(endpoint_url, [None, self.agent])
self.assertPostNotPermitted(endpoint_url, [None, self.user, self.agent])
self.assertPostNotPermitted(endpoint_url, [None, self.agent])
self.assertDeleteNotAllowed(endpoint_url)

joe = self.create_contact("Joe Blow", phone="+250788123123")
Expand All @@ -29,7 +29,7 @@ def test_endpoint(self):
# no filtering
response = self.assertGet(
endpoint_url,
[self.user, self.editor, self.admin],
[self.editor, self.admin],
results=[
{
"uuid": str(campaign2.uuid),
Expand Down
Loading

0 comments on commit 518a8cc

Please sign in to comment.