Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tests for state transition #83

Open
drwlrsn opened this issue Jul 11, 2018 · 0 comments
Open

Remove tests for state transition #83

drwlrsn opened this issue Jul 11, 2018 · 0 comments

Comments

@drwlrsn
Copy link
Collaborator

drwlrsn commented Jul 11, 2018

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)

drwlrsn added a commit that referenced this issue Jul 11, 2018
Issue #83 has been created for this.
drwlrsn added a commit that referenced this issue Jul 11, 2018
Issue #83 has been created for this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant