'Try to update a model instance introducing a FK constraint violation.
If it fails it should fail with IntegrityError.'

def test_integrity_checks_on_update(self):

    models.Article.objects.create(headline=u'Test    article', pub_date=datetime.datetime(2010, 9, 4), reporter=self.r)
    a1 = models.Article.objects.get(headline=u'Test    article')
    a1.reporter_id = 30
    try:
        a1.save()
    except IntegrityError:
        pass
    else:
        self.skipTest(u'This    backend    does    not    support    integrity    checks.')
    r_proxy = models.ReporterProxy.objects.get(pk=self.r.pk)
    models.Article.objects.create(headline=u'Another    article', pub_date=datetime.datetime(1988, 5, 15), reporter=self.r, reporter_proxy=r_proxy)
    a2 = models.Article.objects.get(headline=u'Another    article')
    a2.reporter_proxy_id = 30
    self.assertRaises(IntegrityError, a2.save)
