diff options
author | Matthew Lemon <y@yulqen.org> | 2024-09-09 16:55:09 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-09-09 16:55:09 +0100 |
commit | 0bef50c8097ab52df424c94176e913dcb1d8f7f5 (patch) | |
tree | b1f92c0958062233a84b788e43b2a49695c1f975 /pyblackbird_cc/payments/tests/test_models.py | |
parent | 31966b6cbef88006056db44448cdaf59ba40533e (diff) |
Clean up and sort imports
Diffstat (limited to 'pyblackbird_cc/payments/tests/test_models.py')
-rw-r--r-- | pyblackbird_cc/payments/tests/test_models.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pyblackbird_cc/payments/tests/test_models.py b/pyblackbird_cc/payments/tests/test_models.py index 342ff14..132d025 100644 --- a/pyblackbird_cc/payments/tests/test_models.py +++ b/pyblackbird_cc/payments/tests/test_models.py @@ -3,16 +3,16 @@ from allauth.account.signals import user_signed_up from django.contrib.auth import get_user_model from django.test import RequestFactory -from pyblackbird_cc.payments.models import SubscriptionPlan, Subscription +from pyblackbird_cc.payments.models import Subscription +from pyblackbird_cc.payments.models import SubscriptionPlan User = get_user_model() + @pytest.fixture def user_data(): - return { - 'email': 'testuser@example.com', - 'password': 'testpassword123' - } + return {"email": "testuser@example.com", "password": "testpassword123"} + @pytest.mark.django_db def test_user_signup_assigns_free_subscription(user_data): @@ -23,11 +23,11 @@ def test_user_signup_assigns_free_subscription(user_data): "price": 0, "description": "Free plan description", "allowed_downloads": 10, - } - ) # Create a new user + }, + ) # Create a new user user = User.objects.create_user(**user_data) # Manually trigger the user_signed_up signal - request = RequestFactory().get('/') + request = RequestFactory().get("/") user_signed_up.send(sender=user.__class__, request=request, user=user) # Check if a SubscriptionPlan was created for the user @@ -38,4 +38,4 @@ def test_user_signup_assigns_free_subscription(user_data): assert subscription.plan == free_plan # Additional assertions can be added here to check other properties - # of the SubscriptionPlan or Subscription as needed
\ No newline at end of file + # of the SubscriptionPlan or Subscription as needed |