mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Allow to use datetime components in invoice prefixes (#1529)
This commit is contained in:
@@ -419,6 +419,10 @@ def test_invoice_number_prefixes(env):
|
||||
assert i.number == 'inv_00001'
|
||||
assert generate_cancellation(i).number == 'crd_00001'
|
||||
|
||||
event2.settings.set('invoice_numbers_prefix', 'inv_%Y%m%d_')
|
||||
i = generate_invoice(order2)
|
||||
assert i.number == 'inv_%s_00001' % now().date().strftime('%Y%m%d')
|
||||
|
||||
# Test database uniqueness check
|
||||
with pytest.raises(DatabaseError):
|
||||
with transaction.atomic():
|
||||
|
||||
Reference in New Issue
Block a user