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.

19 lines
518 B

  1. from django.contrib.auth.models import User
  2. from django.test import TestCase
  3. from hc.api.models import Check
  4. class AddCheckTestCase(TestCase):
  5. def setUp(self):
  6. self.alice = User(username="alice")
  7. self.alice.set_password("password")
  8. self.alice.save()
  9. def test_it_works(self):
  10. url = "/checks/add/"
  11. self.client.login(username="alice", password="password")
  12. r = self.client.post(url)
  13. assert r.status_code == 302
  14. assert Check.objects.count() == 1