aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/payments
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-09-12 17:17:47 +0100
committerMatthew Lemon <y@yulqen.org>2024-09-12 17:17:47 +0100
commit6b078722429f738cabb54a46d7dda47238d5de0b (patch)
treed5abdc8cdb86b622f9505cb42b2f4c17e60577ee /pyblackbird_cc/payments
parent2551cc25ff5369d962514d8d4bfca127ebcfabb3 (diff)
wip: starting to tidy up
Diffstat (limited to 'pyblackbird_cc/payments')
-rw-r--r--pyblackbird_cc/payments/tests/test_models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pyblackbird_cc/payments/tests/test_models.py b/pyblackbird_cc/payments/tests/test_models.py
index 467d6e4..65e7484 100644
--- a/pyblackbird_cc/payments/tests/test_models.py
+++ b/pyblackbird_cc/payments/tests/test_models.py
@@ -29,10 +29,10 @@ def test_subscription_user_unique():
# Create a new user
user_data = {"email": "testuser@example.com", "password": "testpassword123"}
- user = User.objects.create_user(**user_data)
+ user = User.objects.create_user(**user_data) # type: ignore
# Create a subscription for the user
- subscription = Subscription.objects.create(user=user, plan=free_plan)
+ Subscription.objects.create(user=user, plan=free_plan)
# Try to create another subscription for the same user
with pytest.raises(IntegrityError):
@@ -50,13 +50,13 @@ def test_user_signup_assigns_free_subscription(user_data):
"allowed_downloads": 10,
},
) # Create a new user
- user = User.objects.create_user(**user_data)
+ user = User.objects.create_user(**user_data) # type: ignore
# Manually trigger the user_signed_up signal
request = RequestFactory().get("/")
user_signed_up.send(sender=user.__class__, request=request, user=user)
# Check if a SubscriptionPlan was created for the user
- subscription = Subscription.objects.filter(user=user).first()
+ subscription = user.subscription
assert subscription is not None
# Check if the assigned plan is the free plan