diff --git a/aa_stripe/models.py b/aa_stripe/models.py index 44c6a04..aac809d 100644 --- a/aa_stripe/models.py +++ b/aa_stripe/models.py @@ -410,7 +410,7 @@ def charge(self, idempotency_key=None, payment_uuid=None): "object_id": self.object_id, "content_type_id": self.content_type_id, "member_uuid": str(self.user.uuid), - "custody": "roman_api", + "origin": "roman_api", } if payment_uuid: metadata["payment_uuid"] = str(payment_uuid) diff --git a/tests/conftest.py b/tests/conftest.py index 0730f8a..cc3a733 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -19,12 +19,13 @@ def pytest_configure(): "django.contrib.admin", "django.contrib.sites", "rest_framework", - "aa_stripe" + "aa_stripe", + "tests", ), + AUTH_USER_MODEL="tests.TestUser", ROOT_URLCONF="aa_stripe.api_urls", TESTING=True, - ENV_PREFIX="test-env", STRIPE_SETTINGS_API_KEY="apikey", - STRIPE_SETTINGS_WEBHOOK_ENDPOINT_SECRET="fake" + STRIPE_SETTINGS_WEBHOOK_ENDPOINT_SECRET="fake", ) diff --git a/tests/models.py b/tests/models.py new file mode 100644 index 0000000..508cba8 --- /dev/null +++ b/tests/models.py @@ -0,0 +1,8 @@ +import uuid + +from django.contrib.auth.models import AbstractUser +from django.db import models + + +class TestUser(AbstractUser): + uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True) diff --git a/tests/test_charge.py b/tests/test_charge.py index d560888..cd1dd50 100644 --- a/tests/test_charge.py +++ b/tests/test_charge.py @@ -144,6 +144,8 @@ def test_charge_with_idempotency_key(self, charge_create_mocked): metadata={ "object_id": self.charge.object_id, "content_type_id": self.charge.content_type_id, + "origin": "roman_api", + "member_uuid": str(self.user.uuid), }, )