def test_create_item_with_enum(self):
        """
        REST Api: Test create item with enum
        """
        client = self.app.test_client()
        token = self.login(client, USERNAME_ADMIN, PASSWORD_ADMIN)
        item = dict(enum1="e1", enum2=1)
        uri = "api/v1/modelwithenumsapi/"
        rv = self.auth_client_post(client, token, uri, item)
        data = json.loads(rv.data.decode("utf-8"))
        self.assertEqual(rv.status_code, 201)
        model = self.db.session.query(ModelWithEnums).get(data["id"])
        self.assertEqual(model.enum1, "e1")
        self.assertEqual(model.enum2, TmpEnum.e1)

        # Revert test data
        self.appbuilder.get_session.query(ModelWithEnums).filter_by(
            id=data["id"]
        ).delete()
        self.appbuilder.get_session.commit()

        REST Api: Test create item with enum
        
tests/test_api.py