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.

20 lines
661 B

9 years ago
9 years ago
9 years ago
  1. from django.contrib.auth.models import User
  2. from django.test import TestCase
  3. from hc.api.models import Check
  4. class MyChecksTestCase(TestCase):
  5. def setUp(self):
  6. super(MyChecksTestCase, self).setUp()
  7. self.alice = User(username="alice", email="[email protected]")
  8. self.alice.set_password("password")
  9. self.alice.save()
  10. self.check = Check(user=self.alice, name="Alice Was Here")
  11. self.check.save()
  12. def test_it_works(self):
  13. self.client.login(username="[email protected]", password="password")
  14. r = self.client.get("/checks/")
  15. self.assertContains(r, "Alice Was Here", status_code=200)