aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/payments/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-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