We now do async validation, so tests that rely on validation to prevent a transition do not work.
|
# def test_assessed_cannot_transition(self): |
|
# bike = mommy.make('bike.Bike') |
|
# client = APIClient() |
|
# client.force_authenticate(user=self.user, token='blah') |
|
# result = client.put(f'/api/v1/bikes/{bike.id}/assessed/') |
|
# |
|
# self.assertEqual(result.status_code, status.HTTP_400_BAD_REQUEST) |
|
|
|
# def test_assessed_still_cannot_transition(self): |
|
# data = { |
|
# "colour": "black", |
|
# "make": "Miyata", |
|
# "serial_number": "12345676", |
|
# "source": Bike.COS_BIKE_DIVERSION_PILOT, |
|
# "donated_by": "Greg", |
|
# "donated_at": "2017-01-01", |
|
# } |
|
# bike = Bike.objects.create(**data) |
|
# client = APIClient() |
|
# client.force_authenticate(user=self.user, token='blah') |
|
# result = client.put(f'/api/v1/bikes/{bike.id}/assessed/') |
|
# |
|
# self.assertEqual(result.status_code, status.HTTP_400_BAD_REQUEST) |
|
# def test_available_cannot_transition(self): |
|
# data = { |
|
# "colour": "black", |
|
# "make": "Miyata", |
|
# "serial_number": "12345676", |
|
# "source": Bike.COS_BIKE_DIVERSION_PILOT, |
|
# "donated_by": "Greg", |
|
# "donated_at": "2017-01-01", |
|
# "size": Bike.SMALL, |
|
# "price": '68.00', |
|
# "state": BikeState.ASSESSED |
|
# } |
|
# bike = Bike.objects.create(**data) |
|
# client = APIClient() |
|
# client.force_authenticate(user=self.user, token='blah') |
|
# result = client.put(f'/api/v1/bikes/{bike.id}/available/') |
|
# |
|
# self.assertEqual(result.status_code, status.HTTP_400_BAD_REQUEST) |
We now do async validation, so tests that rely on validation to prevent a transition do not work.
workstand/bikeshop_project/bike/tests/test_api.py
Lines 78 to 100 in ebb701e
workstand/bikeshop_project/bike/tests/test_api.py
Lines 119 to 136 in ebb701e