Skip to content

Commit

Permalink
Merge pull request #605 from praekeltfoundation/capi-backend-changes
Browse files Browse the repository at this point in the history
Remove status from read only fields
  • Loading branch information
erikh360 authored Jul 16, 2024
2 parents d3a1fa6 + fb0d2ea commit 2930ac3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion eventstore/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,5 +479,4 @@ class Meta:
"sent_at",
"event_received_at",
"preferred_channel",
"status",
)
9 changes: 8 additions & 1 deletion eventstore/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3237,9 +3237,16 @@ def test_change_object(self):
self.client.force_authenticate(user)

response = self.client.patch(
self.url, {"registration_completed_at": timezone.now()}
self.url,
{
"registration_completed_at": timezone.now(),
"status": WhatsAppTemplateSendStatus.Status.REGISTRATION_COMPLETED,
},
)

self.status.refresh_from_db()
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertIsNotNone(self.status.registration_completed_at)
self.assertEqual(
self.status.status, WhatsAppTemplateSendStatus.Status.REGISTRATION_COMPLETED
)

0 comments on commit 2930ac3

Please sign in to comment.