def test_group_link_with_profile(self): g = GroupFactory() g.save() p = GroupProfile.objects.create(group=g, slug="foo") text = group_link(g) doc = pq(text) eq_(reverse("groups.profile", args=[p.slug]), doc("a")[0].attrib["href"]) eq_(g.name, doc("a")[0].text)
def test_group_link_with_profile(self): g = GroupFactory() g.save() p = GroupProfile.objects.create(group=g, slug='foo') text = group_link(g) doc = pq(text) eq_(reverse('groups.profile', args=[p.slug]), doc('a')[0].attrib['href']) eq_(g.name, doc('a')[0].text)
def test_right_group_profile(self): """Make sure we get the right group profile.""" g1 = GroupFactory(pk=100) g1.save() eq_(100, g1.pk) g2 = GroupFactory(pk=101) g2.save() eq_(101, g2.pk) p = GroupProfileFactory(pk=100, group=g2, slug="foo") eq_(100, p.pk) eq_(group_link(g1), g1.name)
def test_right_group_profile(self): """Make sure we get the right group profile.""" g1 = GroupFactory(pk=100) g1.save() eq_(100, g1.pk) g2 = GroupFactory(pk=101) g2.save() eq_(101, g2.pk) p = GroupProfileFactory(pk=100, group=g2, slug='foo') eq_(100, p.pk) eq_(group_link(g1), g1.name)
def test_group_link_no_profile(self): g = GroupFactory() text = group_link(g) eq_(g.name, text)