User session tracking #93587
16
bid_main/tests/test_user_sessions.py
Normal file
16
bid_main/tests/test_user_sessions.py
Normal file
@ -0,0 +1,16 @@
|
||||
from django.test import TestCase
|
||||
from django.test.client import Client
|
||||
|
||||
from bid_main.tests.factories import UserFactory
|
||||
|
||||
|
||||
class TestUserSessions(TestCase):
|
||||
def test_records_created_and_delete(self):
|
||||
user = UserFactory()
|
||||
client1 = Client()
|
||||
client2 = Client()
|
||||
client1.force_login(user)
|
||||
client2.force_login(user)
|
||||
self.assertEqual(user.sessions.count(), 2)
|
||||
client2.logout()
|
||||
self.assertEqual(user.sessions.count(), 1)
|
Loading…
Reference in New Issue
Block a user