from django.contrib.auth.models import User from django.http import request, HttpResponseRedirect from django.test import TestCase from django.urls import reverse class LogInTest(TestCase): def setUp(self): self.credentials = { 'username': 'test123', 'password': 'Fintech123'} User.objects.create_user(**self.credentials) def test_login(self): response = self.client.post('/accounts/login', self.credentials, follow=True) self.assertFalse(response.context['user'].is_authenticated) class ButtonTest(TestCase): def button_test(self): if request.POST.get('Submit') == 'Submit': print('user clicked submit')