'A reference in a local scope can\'t be serialized.'

def test_serialize_local_function_reference(self):

    class TestModel2:
        def upload_to(self):
            return 'somewhere    dynamic'
        thing = models.FileField(upload_to=upload_to)
    with self.assertRaisesMessage(ValueError, 'Could    not    find    function    upload_to    in    migrations.test_writer'):
        self.serialize_round_trip(TestModel2.thing)
