Skip to content

Instantly share code, notes, and snippets.

@katiayn
Created January 23, 2017 22:15
Show Gist options
  • Save katiayn/80d8dd7a5958d9994009f401f3dc1a86 to your computer and use it in GitHub Desktop.
Save katiayn/80d8dd7a5958d9994009f401f3dc1a86 to your computer and use it in GitHub Desktop.
class ProductQuestionnaireTestCase(TestCase):
def test_vat_20_if_biscuit_coated_in_chocolate(self):
product = ProductFactory()
form = ProductQuestionnaireForm(data={
'is_biscuit': True,
'is_coated_in_chocolate': True
})
self.assertTrue(form.is_valid())
form.save()
product.refresh_from_db()
self.assertEqual(product.vat, 20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment