def test_overwrite_property(self): with self.assertRaises(ValueError) as cm: MediaFile.add_field('artist', MediaField()) self.assertIn(u'property "artist" already exists', unicode(cm.exception))
def test_invalid_descriptor(self): with self.assertRaises(ValueError) as cm: MediaFile.add_field('somekey', True) self.assertIn(u'must be an instance of MediaField', unicode(cm.exception))