'#21430 -- Verifies a warning is raised for models that are
unpickled without a Django version'

def test_missing_django_version_unpickling(self):

    class MissingDjangoVersion(models.Model, ):
        title = models.CharField(max_length=10)
        def __reduce__(self):
            reduce_list = super().__reduce__()
            data = reduce_list[(-1)]
            del data[DJANGO_VERSION_PICKLE_KEY]
            return reduce_list
    p = MissingDjangoVersion(title='FooBar')
    msg = "Pickled    model    instance's    Django    version    is    not    specified."
    with self.assertRaisesMessage(RuntimeWarning, msg):
        pickle.loads(pickle.dumps(p))
