Exemplo n.º 1
0
    def test_exception(self):
        class BrokenModel(models.Model):
            birthday = BirthdayField()

        self.assertRaises(FieldError,
                          BirthdayField().contribute_to_class, BrokenModel,
                          'another_birthday')
Exemplo n.º 2
0
class TestModel(models.Model):
    birthday = BirthdayField()
    objects = BirthdayManager()

    class Meta:
        app_label = 'birthday'
        ordering = ('pk', )
Exemplo n.º 3
0
class TestModel(models.Model):
    birthday = BirthdayField()

    objects = BirthdayManager()

    class Meta:
        ordering = ['id']
Exemplo n.º 4
0
    def test_04_exceptions(self):
        class FailModel(models.Model):
            bd1 = BirthdayField()

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

    objects = BirthdayManager()
Exemplo n.º 7
0
 class FailModel(models.Model):
     bd1 = BirthdayField()