def test_avalue_bvalue_validation(self):
    foo = models.Foo()
foo.a_value = 30
foo.b_value = True
bar = Mock(spec=models.Bar)
bar._state = Mock()
How to use Mock library to mock a Django ForeignKey value?