Пример #1
0
    def test_set_attr_correctly_sets__errors(self):
        document = Document(Collection)
        document._errors = {'test': 'test'}

        self.assertEqual(document._errors, {'test': 'test'})
Пример #2
0
    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
    def test_errors_returns_empty_dict_if_no_errors(self):
        document = Document(Collection, {})
        document._errors = {}

        self.assertEqual({}, document.errors)
Пример #4
0
    def test_is_valid_returns_true_if_no_errors(self):
        document = Document(Collection)
        document._errors = {}

        self.assertTrue(Document(Collection).is_valid)