mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
billing: Add randomness to idempotency key while testing.
Makes it easier to test or regenerate fixtures for test_billing_quantity_changes_end_to_end with generate=True.
This commit is contained in:
@@ -356,6 +356,8 @@ def process_billing_log_entry(processor: BillingProcessor, log_row: RealmAuditLo
|
||||
customer = Customer.objects.get(realm=log_row.realm)
|
||||
timestamp = datetime_to_timestamp(log_row.event_time)
|
||||
idempotency_key = 'process_billing_log_entry:%s' % (log_row.id,)
|
||||
if settings.TEST_SUITE:
|
||||
idempotency_key += '+' + generate_random_token(10)
|
||||
extra_args = {} # type: Dict[str, Any]
|
||||
if log_row.extra_data is not None:
|
||||
extra_args = ujson.loads(log_row.extra_data)
|
||||
|
||||
Reference in New Issue
Block a user