Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ffont committed Feb 13, 2024
1 parent 2b2882a commit 4a7e981
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tickets/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def _perform_action(self, action):
def test_delete_ticket_from_queue(self, delete_sound_solr, post_moderation_assigned_tickets_task):
resp = self._perform_action('Delete')

self.assertEqual(resp.status_code, 200)
self.assertIn(resp.status_code, [200, 302]) # This test is reused, and the response code is different in each case
delete_sound_solr.assert_called_once_with([self.sound.id])

self.ticket.refresh_from_db()
Expand All @@ -216,19 +216,19 @@ def _assert_ticket_and_sound_fields(self, status, assignee, moderation_state):
@mock.patch('general.tasks.post_moderation_assigned_tickets.delay')
def test_approve_ticket_from_queue(self, post_moderation_assigned_tickets_task):
resp = self._perform_action('Approve')
self.assertEqual(resp.status_code, 200)
self.assertIn(resp.status_code, [200, 302]) # This test is reused, and the response code is different in each case
self._assert_ticket_and_sound_fields(TICKET_STATUS_CLOSED, self.test_moderator, 'OK')

@mock.patch('general.tasks.post_moderation_assigned_tickets.delay')
def test_return_ticket_from_queue(self, post_moderation_assigned_tickets_task):
resp = self._perform_action('Return')
self.assertEqual(resp.status_code, 200)
self.assertIn(resp.status_code, [200, 302]) # This test is reused, and the response code is different in each case
self._assert_ticket_and_sound_fields(TICKET_STATUS_NEW, None, 'PE')

@mock.patch('general.tasks.post_moderation_assigned_tickets.delay')
def test_defer_ticket_from_queue(self, post_moderation_assigned_tickets_task):
resp = self._perform_action('Defer')
self.assertEqual(resp.status_code, 200)
self.assertIn(resp.status_code, [200, 302]) # This test is reused, and the response code is different in each case
self._assert_ticket_and_sound_fields(TICKET_STATUS_DEFERRED, self.test_moderator, 'PE')


Expand Down

0 comments on commit 4a7e981

Please sign in to comment.