'Regression for #18432: Chained foreign keys with to_field produce incorrect query'

def test_chained_fks(self):

    m1 = Model1.objects.create(pkey=1000)
    m2 = Model2.objects.create(model1=m1)
    m3 = Model3.objects.create(model2=m2)
    m3 = Model3.objects.get(model2=1000)
    m3.model2
