You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

17 lines
544 B

from django.contrib.auth.models import User
from django.test import TestCase
from hc.accounts.models import Profile
class TeamAccessMiddlewareTestCase(TestCase):
def test_it_handles_missing_profile(self):
user = User(username="ned", email="[email protected]")
user.set_password("password")
user.save()
self.client.login(username="[email protected]", password="password")
r = self.client.get("/docs/")
self.assertEqual(r.status_code, 200)
self.assertEqual(Profile.objects.count(), 1)