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