2023-11-11 13:50:14 -05:00
|
|
|
from django.test import TestCase
|
|
|
|
|
|
|
|
from django.test.client import Client
|
|
|
|
from django.contrib.auth.models import User
|
|
|
|
from django.contrib.auth import login
|
|
|
|
|
|
|
|
class LoginTest(TestCase):
|
|
|
|
def setUp(self):
|
|
|
|
self.client = Client()
|
|
|
|
|
2023-11-30 07:39:22 -05:00
|
|
|
self.url = "/api/accounts/logout"
|
2023-11-11 13:50:14 -05:00
|
|
|
|
|
|
|
self.client.login()
|
|
|
|
|
|
|
|
def test_normal_logout(self):
|
|
|
|
response: HttpResponse = self.client.post(self.url)
|
|
|
|
self.assertNotIn('_auth_user_id', self.client.session)
|