Files
offline-db/users/tests/test_models.py
google-labs-jules[bot] a957bbfe52 fix(core): auto-repair & stability improvements (#48)
- Generated missing migrations for users, billing, content, and core apps.
- Updated content/tests.py to match new Season/Episode relationship.
- Created users/tests/test_models.py and removed conflicting users/tests.py.
- Fixed Wallet.__str__ formatting.
- Current Focus Mode: A
- Changes Made: Generated migrations, refactored tests, fixed model method.
- Impact on System: Restored database consistency and test suite stability.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-01-19 10:36:54 +00:00

20 lines
788 B
Python

from django.test import TestCase
from django.contrib.auth import get_user_model
from users.models import Wallet
User = get_user_model()
class UserTests(TestCase):
def test_create_user(self):
user = User.objects.create_user(username='testuser', password='password123')
self.assertEqual(user.username, 'testuser')
self.assertFalse(user.is_premium)
self.assertTrue(user.check_password('password123'))
def test_wallet_creation(self):
user = User.objects.create_user(username='walletuser', password='password123')
wallet = Wallet.objects.create(user=user, balance=100.00)
self.assertEqual(wallet.user, user)
self.assertEqual(wallet.balance, 100.00)
self.assertEqual(str(wallet), "walletuser's Wallet: 100.00")