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
699 B

  1. from hc.test import BaseTestCase
  2. from hc.api.models import Check
  3. class BadgesTestCase(BaseTestCase):
  4. def test_it_shows_badges(self):
  5. self.client.login(username="[email protected]", password="password")
  6. Check.objects.create(project=self.project, tags="foo a-B_1 baz@")
  7. Check.objects.create(project=self.bobs_project, tags="bobs-tag")
  8. r = self.client.get("/accounts/profile/badges/")
  9. self.assertContains(r, "foo.svg")
  10. self.assertContains(r, "a-B_1.svg")
  11. # Expect badge URLs only for tags that match \w+
  12. self.assertNotContains(r, "[email protected]")
  13. # Expect only Alice's tags
  14. self.assertNotContains(r, "bobs-tag.svg")