コード例 #1
0
    def test_serializer_for_nonexistent(self):
        """Tests that attempting to get the serializer for an unknown
        model yields an error.

        """
        with self.assertRaises(ValueError):
            serializer_for(self.Person)
コード例 #2
0
    def test_serializer_for_nonexistent(self):
        """Tests that attempting to get the serializer for an unknown
        model yields an error.

        """
        with self.assertRaises(ValueError):
            serializer_for(self.Person)
コード例 #3
0
ファイル: test_manager.py プロジェクト: t-fox/flask-restless
    def test_serializer_for(self):
        """Tests the global :func:`flask.ext.restless.serializer_for`
        function.

        """
        def my_function(*args, **kw):
            pass

        self.manager.create_api(self.Person, serializer=my_function)
        assert serializer_for(self.Person) == my_function
コード例 #4
0
ファイル: test_manager.py プロジェクト: jwg4/flask-restless
    def test_serializer_for(self):
        """Tests the global :func:`flask.ext.restless.serializer_for`
        function.

        """
        def my_function(*args, **kw):
            pass

        self.manager.create_api(self.Person, serializer=my_function)
        assert serializer_for(self.Person) == my_function
コード例 #5
0
    def test_serializer_for(self):
        """Tests the global :func:`flask.ext.restless.serializer_for`
        function.

        """
        class MySerializer(DefaultSerializer):
            pass

        self.manager.create_api(self.Person, serializer_class=MySerializer)
        assert isinstance(serializer_for(self.Person), MySerializer)
コード例 #6
0
    def test_serializer_for(self):
        """Tests the global :func:`flask.ext.restless.serializer_for`
        function.

        """

        class MySerializer(DefaultSerializer):
            pass

        self.manager.create_api(self.Person, serializer_class=MySerializer)
        assert isinstance(serializer_for(self.Person), MySerializer)
コード例 #7
0
ファイル: test_manager.py プロジェクト: t-fox/flask-restless
    def test_serializer_for_nonexistent(self):
        """Tests that attempting to get the serializer for an unknown
        model yields an error.

        """
        serializer_for(self.Person)
コード例 #8
0
ファイル: test_manager.py プロジェクト: jwg4/flask-restless
    def test_serializer_for_nonexistent(self):
        """Tests that attempting to get the serializer for an unknown
        model yields an error.

        """
        serializer_for(self.Person)