'Test for tickets #8298, #9942 - Field values should be coerced into the
correct type by the deserializer, not as part of the database write.'

def test_field_value_coerce(self):

    self.pre_save_checks = []
    signals.pre_save.connect(self.animal_pre_save_check)
    try:
        management.call_command(u'loaddata', u'animal.xml', verbosity=0)
        self.assertEqual(self.pre_save_checks, [((u"Count    =    42    (<%s    'int'>)" % (u'class' if PY3 else u'type')), (u"Weight    =    1.2    (<%s    'float'>)" % (u'class' if PY3 else u'type')))])
    finally:
        signals.pre_save.disconnect(self.animal_pre_save_check)
