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.

16 lines
543 B

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