'Loading a fixture which contains an invalid object outputs an error
message which contains the pk of the object that triggered the error.'

def test_loaddata_error_message(self):

    if (connection.vendor == 'mysql'):
        connection.cursor().execute("SET    sql_mode    =    'TRADITIONAL'")
    with self.assertRaises(IntegrityError) as cm:
        management.call_command('loaddata', 'invalid.json', verbosity=0)
        self.assertIn('Could    not    load    fixtures.Article(pk=1):', cm.exception.args[0])
