コード例 #1
0
ファイル: document.py プロジェクト: mathvaleriano/mongorest
    def test_set_attr_correctly_sets__errors(self):
        document = Document(Collection)
        document._errors = {'test': 'test'}

        self.assertEqual(document._errors, {'test': 'test'})
コード例 #2
0
ファイル: document.py プロジェクト: mathvaleriano/mongorest
    def test_is_valid_returns_false_if_there_are_errors(self):
        document = Document(Collection)
        document._errors = {'test': 'test'}

        self.assertFalse(document.is_valid)
コード例 #3
0
ファイル: document.py プロジェクト: mathvaleriano/mongorest
    def test_errors_returns_empty_dict_if_no_errors(self):
        document = Document(Collection, {})
        document._errors = {}

        self.assertEqual({}, document.errors)
コード例 #4
0
ファイル: document.py プロジェクト: mathvaleriano/mongorest
    def test_is_valid_returns_true_if_no_errors(self):
        document = Document(Collection)
        document._errors = {}

        self.assertTrue(Document(Collection).is_valid)