Exemplo n.º 1
0
    def test_storage_remembers_type(self):
        from model import TextModel, EquationModel, ImageModel, WrenModel
        text_model = TextModel('text1')
        text_model.save()
        equation_model = EquationModel('equation1')
        equation_model.save()
        image_model = ImageModel('image1')
        image_model.save()

        self.assertIsInstance(WrenModel.load(text_model.key),
                              TextModel)
        self.assertIsInstance(WrenModel.load(equation_model.key),
                              EquationModel)
        self.assertIsInstance(WrenModel.load(image_model.key),
                              ImageModel)