Skip to content

Remove tests for state transition #83

Description

@drwlrsn

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions