def test_exception(self): class BrokenModel(models.Model): birthday = BirthdayField() self.assertRaises(FieldError, BirthdayField().contribute_to_class, BrokenModel, 'another_birthday')
class TestModel(models.Model): birthday = BirthdayField() objects = BirthdayManager() class Meta: app_label = 'birthday' ordering = ('pk', )
class TestModel(models.Model): birthday = BirthdayField() objects = BirthdayManager() class Meta: ordering = ['id']
def test_04_exceptions(self): class FailModel(models.Model): bd1 = BirthdayField() bdf2 = BirthdayField() self.assertRaises(FieldError, bdf2.contribute_to_class, FailModel, 'bdf2')
class BrokenModel(models.Model): birthday = BirthdayField()
class TestModel2(models.Model): birthday = BirthdayField(null=True) objects = BirthdayManager()
class FailModel(models.Model): bd1 = BirthdayField()