def test_set_attr_correctly_sets__errors(self): document = Document(Collection) document._errors = {'test': 'test'} self.assertEqual(document._errors, {'test': 'test'})
def test_is_valid_returns_false_if_there_are_errors(self): document = Document(Collection) document._errors = {'test': 'test'} self.assertFalse(document.is_valid)
def test_errors_returns_empty_dict_if_no_errors(self): document = Document(Collection, {}) document._errors = {} self.assertEqual({}, document.errors)
def test_is_valid_returns_true_if_no_errors(self): document = Document(Collection) document._errors = {} self.assertTrue(Document(Collection).is_valid)