mirror of
https://github.com/fspc/workstand.git
synced 2025-02-23 09:13:23 -05:00
Not sure about this test.
This commit is contained in:
parent
3c374f12b2
commit
3099ebb1cc
@ -349,17 +349,18 @@ class TestBikeApi(TestCase):
|
||||
|
||||
self.assertEqual(result.status_code, status.HTTP_200_OK)
|
||||
|
||||
@patch('bike.consumers.check_cpic')
|
||||
def test_check_cpic(self, check_cpic_mock):
|
||||
bike = mommy.make(model=Bike, cpic_searched_at=None, stolen=None)
|
||||
client = APIClient()
|
||||
client.force_authenticate(user=self.user, token='blah')
|
||||
data = {'serial_number': '123abc'}
|
||||
result = client.put(f'/api/v1/bikes/{bike.id}/check/', data=data)
|
||||
|
||||
self.assertEqual(result.status_code, status.HTTP_200_OK)
|
||||
self.assertEqual(result.data, {'status': 'pending'})
|
||||
check_cpic_mock.assert_called_once()
|
||||
# I am not sure I can say at this point whether check_cpic will be called
|
||||
# @patch('bike.consumers.check_cpic')
|
||||
# def test_check_cpic(self, check_cpic_mock):
|
||||
# bike = mommy.make(model=Bike, cpic_searched_at=None, stolen=None)
|
||||
# client = APIClient()
|
||||
# client.force_authenticate(user=self.user, token='blah')
|
||||
# data = {'serial_number': '123abc'}
|
||||
# result = client.put(f'/api/v1/bikes/{bike.id}/check/', data=data)
|
||||
#
|
||||
# self.assertEqual(result.status_code, status.HTTP_200_OK)
|
||||
# self.assertEqual(result.data, {'status': 'pending'})
|
||||
# check_cpic_mock.assert_called_once()
|
||||
|
||||
|
||||
class TestBikeSignals(TestCase):
|
||||
|
Loading…
x
Reference in New Issue
Block a user