예제 #1
0
    def test_exception(self):
        class BrokenModel(models.Model):
            birthday = BirthdayField()

        self.assertRaises(FieldError,
                          BirthdayField().contribute_to_class, BrokenModel,
                          'another_birthday')
예제 #2
0
class TestModel(models.Model):
    birthday = BirthdayField()
    objects = BirthdayManager()

    class Meta:
        app_label = 'birthday'
        ordering = ('pk', )
예제 #3
0
class TestModel(models.Model):
    birthday = BirthdayField()

    objects = BirthdayManager()

    class Meta:
        ordering = ['id']
예제 #4
0
    def test_04_exceptions(self):
        class FailModel(models.Model):
            bd1 = BirthdayField()

        bdf2 = BirthdayField()
        self.assertRaises(FieldError, bdf2.contribute_to_class, FailModel,
                          'bdf2')
예제 #5
0
 class BrokenModel(models.Model):
     birthday = BirthdayField()
예제 #6
0
class TestModel2(models.Model):
    birthday = BirthdayField(null=True)

    objects = BirthdayManager()
예제 #7
0
 class FailModel(models.Model):
     bd1 = BirthdayField()