Fix incorrect test case

This commit is contained in:
Raphael Michel
2018-03-02 22:05:56 +01:00
parent 08e3fd3141
commit 5c7e8029f4

View File

@@ -418,8 +418,8 @@ class CheckoutTestCase(TestCase):
def test_custom_tax_rules(self):
self.tr19.custom_rules = json.dumps([
{'country': 'AT', 'address_type': '', 'action': 'vat'},
{'country': 'ZZ', 'address_type': '', 'action': 'reverse'},
{'country': 'AT', 'address_type': 'business_vat_id', 'action': 'reverse'},
{'country': 'ZZ', 'address_type': '', 'action': 'vat'},
])
self.tr19.save()
self.event.settings.invoice_address_vatid = True
@@ -444,22 +444,24 @@ class CheckoutTestCase(TestCase):
}, follow=True)
cr1.refresh_from_db()
assert cr1.price == Decimal('23.00')
assert cr1.price == Decimal('19.33')
self.client.post('/%s/%s/checkout/questions/' % (self.orga.slug, self.event.slug), {
'is_business': 'business',
'company': 'Foo',
'name': 'Bar',
'street': 'Baz',
'zipcode': '12345',
'city': 'Here',
'country': 'DE',
'vat_id': 'DE123456',
'email': 'admin@localhost'
}, follow=True)
with mock.patch('vat_moss.id.validate') as mock_validate:
mock_validate.return_value = ('DE', 'DE123456', 'Foo')
self.client.post('/%s/%s/checkout/questions/' % (self.orga.slug, self.event.slug), {
'is_business': 'business',
'company': 'Foo',
'name': 'Bar',
'street': 'Baz',
'zipcode': '12345',
'city': 'Here',
'country': 'DE',
'vat_id': 'DE123456',
'email': 'admin@localhost'
}, follow=True)
cr1.refresh_from_db()
assert cr1.price == Decimal('19.33')
assert cr1.price == Decimal('23.00')
def test_question_file_upload(self):
q1 = Question.objects.create(