コード例 #1
0
    def test_model_for_nonexistent(self):
        """Tests that attempting to get the model for a nonexistent collection
        yields an error.

        """
        with self.assertRaises(ValueError):
            model_for('people')
コード例 #2
0
    def test_model_for_nonexistent(self):
        """Tests that attempting to get the model for a nonexistent collection
        yields an error.

        """
        with self.assertRaises(ValueError):
            model_for('people')
コード例 #3
0
ファイル: test_manager.py プロジェクト: t-fox/flask-restless
    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
ファイル: test_manager.py プロジェクト: jwg4/flask-restless
    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
ファイル: test_manager.py プロジェクト: t-fox/flask-restless
    def test_model_for_nonexistent(self):
        """Tests that attempting to get the model for a nonexistent collection
        yields an error.

        """
        model_for('people')
コード例 #6
0
ファイル: test_manager.py プロジェクト: t-fox/flask-restless
 def test_model_for(self):
     """Tests the global :func:`flask.ext.restless.model_for` function."""
     self.manager.create_api(self.Person, collection_name='people')
     assert model_for('people') is self.Person
コード例 #7
0
ファイル: test_manager.py プロジェクト: jwg4/flask-restless
    def test_model_for_nonexistent(self):
        """Tests that attempting to get the model for a nonexistent collection
        yields an error.

        """
        model_for('people')
コード例 #8
0
ファイル: test_manager.py プロジェクト: jwg4/flask-restless
 def test_model_for(self):
     """Tests the global :func:`flask.ext.restless.model_for` function."""
     self.manager.create_api(self.Person, collection_name='people')
     assert model_for('people') is self.Person