Remove the guest system entirely: no is_guest/device_id, no guest throttles, phone login is the only way in
accounts.0008 drops the columns and refuses to run while guest rows exist. Docs describe the current state; tests that only proved guest behaviour are gone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,8 +13,8 @@ from progress.models import UserStats
|
||||
|
||||
class DeleteUsersTests(TestCase):
|
||||
def setUp(self):
|
||||
self.doomed = User.objects.create(phone='09121110001', is_guest=False)
|
||||
self.kept = User.objects.create(phone='09121110002', is_guest=False)
|
||||
self.doomed = User.objects.create(phone='09121110001')
|
||||
self.kept = User.objects.create(phone='09121110002')
|
||||
for user in (self.doomed, self.kept):
|
||||
Profile.objects.create(user=user)
|
||||
UserStats.objects.create(user_id=user.id, xp=10)
|
||||
@@ -51,12 +51,10 @@ class DeleteUsersTests(TestCase):
|
||||
self.assertFalse(Order.objects.filter(user_id=self.doomed.pk).exists())
|
||||
|
||||
@override_settings(TEST_LOGIN_PHONES={'09121110002': '1234'})
|
||||
def test_real_phones_keeps_demo_numbers_and_guests(self):
|
||||
guest = User.objects.create(device_id='guest-x', is_guest=True)
|
||||
def test_real_phones_keeps_demo_numbers(self):
|
||||
self.run_command('--real-phones', '--yes')
|
||||
self.assertFalse(User.objects.filter(pk=self.doomed.pk).exists())
|
||||
self.assertTrue(User.objects.filter(pk=self.kept.pk).exists())
|
||||
self.assertTrue(User.objects.filter(pk=guest.pk).exists())
|
||||
|
||||
def test_skip_paid_keeps_the_payer_and_deletes_the_rest(self):
|
||||
Order.objects.create(user_id=self.doomed.id, amount=1000, status='paid', idempotency_key='k2')
|
||||
|
||||
Reference in New Issue
Block a user