예제 #1
0
    def test_collection_name_nonexistent(self):
        """Tests that attempting to get the collection name for an unknown
        model yields an error.

        """
        with self.assertRaises(ValueError):
            collection_name(self.Person)
예제 #2
0
    def test_collection_name_nonexistent(self):
        """Tests that attempting to get the collection name for an unknown
        model yields an error.

        """
        with self.assertRaises(ValueError):
            collection_name(self.Person)
예제 #3
0
    def test_model_for_collection_name(self):
        """Tests that :func:`flask.ext.restless.model_for` is the inverse of
        :func:`flask.ext.restless.collection_name`.

        """
        self.manager.create_api(self.Person, collection_name='people')
        assert collection_name(model_for('people')) == 'people'
        assert model_for(collection_name(self.Person)) is self.Person
예제 #4
0
    def test_model_for_collection_name(self):
        """Tests that :func:`flask.ext.restless.model_for` is the inverse of
        :func:`flask.ext.restless.collection_name`.

        """
        self.manager.create_api(self.Person, collection_name='people')
        assert collection_name(model_for('people')) == 'people'
        assert model_for(collection_name(self.Person)) is self.Person
예제 #5
0
    def test_collection_name(self):
        """Tests the global :func:`flask.ext.restless.collection_name`
        function.

        """
        self.manager.create_api(self.Person, collection_name='people')
        assert collection_name(self.Person) == 'people'
예제 #6
0
    def test_collection_name(self):
        """Tests the global :func:`flask.ext.restless.collection_name`
        function.

        """
        self.manager.create_api(self.Person, collection_name='people')
        assert collection_name(self.Person) == 'people'
예제 #7
0
    def test_collection_name_nonexistent(self):
        """Tests that attempting to get the collection name for an unknown
        model yields an error.

        """
        collection_name(self.Person)
예제 #8
0
    def test_collection_name_nonexistent(self):
        """Tests that attempting to get the collection name for an unknown
        model yields an error.

        """
        collection_name(self.Person)