Beispiel #1
0
 def test_invalid_value(self):
     widget = NullableForeignKeyWidget(Partner, "name")
     self.assertEqual(widget.clean("unknown partner"), None)
 def test_invalid_value(self):
     widget = NullableForeignKeyWidget(Partner, "name")
     self.assertEqual(widget.clean("unknown partner"), None)
Beispiel #3
0
 def test_valid_value(self):
     widget = NullableForeignKeyWidget(Partner, "name")
     self.assertEqual(widget.clean("test partner").id, self.record.id)
 def test_valid_value(self):
     widget = NullableForeignKeyWidget(Partner, "name")
     self.assertEqual(widget.clean("test partner").id, self.record.id)