コード例 #1
0
ファイル: tests.py プロジェクト: Bonus05/django-relatives
 def test_no_primary_key(self):
     ship = Ship(name="Star of India")
     self.assertEqual(object_link(ship), "Star of India")
コード例 #2
0
ファイル: tests.py プロジェクト: Bonus05/django-relatives
 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>')
コード例 #3
0
ファイル: tests.py プロジェクト: Bonus05/django-relatives
 def test_no_admin_url(self):
     pirate = Pirate.objects.create(id=1, name="Lowell Taylor")
     self.assertEqual(object_link(pirate), "Lowell Taylor")
コード例 #4
0
 def test_no_primary_key(self):
     ship = Ship(name="Star of India")
     self.assertEqual(object_link(ship), "Star of India")
コード例 #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>')
コード例 #6
0
 def test_no_admin_url(self):
     pirate = Pirate.objects.create(id=1, name="Lowell Taylor")
     self.assertEqual(object_link(pirate), "Lowell Taylor")