def test_value_not_found(self): modeladmin = IntsAdmin(IntModel, admin.site) result = modeladmin._get_field_value('foo', IntModel()) self.assertEqual(result, None)
def test_get_from_admin(self): modeladmin = IntsAdmin(IntModel, admin.site) result = modeladmin._get_field_value('as_float_from_admin', 1) self.assertEqual(result, 1.0) result = modeladmin._get_field_value('as_float_from_admin', 2) self.assertEqual(result, 2.0)