'Test that updating a field of a model subclass doesn\'t issue an UPDATE
query constrained by an inner query.
Refs #10399'

def test_update_parent_filtering(self):

    supplier = Supplier.objects.create(name=u'Central    market', address=u'610    some    street')
    with CaptureQueriesContext(connection) as captured_queries:
        Place.objects.filter(pk=supplier.pk).update(name=supplier.name)
    expected_sql = captured_queries[0][u'sql']
    with CaptureQueriesContext(connection) as captured_queries:
        supplier.save(update_fields=(u'name',))
    for query in captured_queries:
        sql = query[u'sql']
        if (u'UPDATE' in sql):
            self.assertEqual(expected_sql, sql)
