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.
 
 
 
 
 

22 lines
789 B

from hc.test import BaseTestCase
from hc.api.models import Check
class BadgesTestCase(BaseTestCase):
def test_it_shows_badges(self):
self.client.login(username="[email protected]", password="password")
Check.objects.create(user=self.alice, tags="foo a-B_1 baz@",
project=self.project)
Check.objects.create(user=self.bob, tags="bobs-tag",
project=self.bobs_project)
r = self.client.get("/accounts/profile/badges/")
self.assertContains(r, "foo.svg")
self.assertContains(r, "a-B_1.svg")
# Expect badge URLs only for tags that match \w+
self.assertNotContains(r, "[email protected]")
# Expect only Alice's tags
self.assertNotContains(r, "bobs-tag.svg")