Exemplo n.º 1
0
 def test_group_link_with_profile(self):
     g = group()
     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)
Exemplo n.º 2
0
 def test_group_link_with_profile(self):
     g = group()
     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)
Exemplo n.º 3
0
    def test_right_group_profile(self):
        """Make sure we get the right group profile."""
        g1 = group(pk=100)
        g1.save()
        eq_(100, g1.pk)
        g2 = group(pk=101)
        g2.save()
        eq_(101, g2.pk)
        p = GroupProfile.objects.create(pk=100, group=g2, slug='foo')
        eq_(100, p.pk)

        eq_(group_link(g1), g1.name)
Exemplo n.º 4
0
    def test_right_group_profile(self):
        """Make sure we get the right group profile."""
        g1 = group(pk=100)
        g1.save()
        eq_(100, g1.pk)
        g2 = group(pk=101)
        g2.save()
        eq_(101, g2.pk)
        p = GroupProfile.objects.create(pk=100, group=g2, slug='foo')
        eq_(100, p.pk)

        eq_(group_link(g1), g1.name)
Exemplo n.º 5
0
 def test_group_link_no_profile(self):
     g = group()
     text = group_link(g)
     eq_(g.name, text)
Exemplo n.º 6
0
 def test_group_link_no_profile(self):
     g = group()
     text = group_link(g)
     eq_(g.name, text)