Beispiel #1
0
 def test_no_primary_key(self):
     ship = Ship(name="Star of India")
     self.assertEqual(object_link(ship), "Star of India")
Beispiel #2
0
 def test_with_primary_key(self):
     ship = Ship.objects.create(id=1, name="Star of India")
     self.assertEqual(object_link(ship),
                      '<a href="/adm/tests/ship/1/">Star of India</a>')
Beispiel #3
0
 def test_no_admin_url(self):
     pirate = Pirate.objects.create(id=1, name="Lowell Taylor")
     self.assertEqual(object_link(pirate), "Lowell Taylor")
Beispiel #4
0
 def test_no_primary_key(self):
     ship = Ship(name="Star of India")
     self.assertEqual(object_link(ship), "Star of India")
Beispiel #5
0
 def test_with_primary_key(self):
     ship = Ship.objects.create(id=1, name="Star of India")
     self.assertEqual(object_link(ship),
                      '<a href="/adm/tests/ship/1/">Star of India</a>')
Beispiel #6
0
 def test_no_admin_url(self):
     pirate = Pirate.objects.create(id=1, name="Lowell Taylor")
     self.assertEqual(object_link(pirate), "Lowell Taylor")