def test_unique_for_date_with_nullable_date(self):
        p1 = FlexibleDatePost.objects.create(title="Django 1.0 is released",
            slug="Django 1.0", subtitle="Finally", posted=datetime.date(2008, 9, 3))

        p = FlexibleDatePost(title="Django 1.0 is released")
        try:
            p.full_clean()
        except __HOLE__, e:
            self.fail("unique_for_date checks shouldn't trigger when the associated DateField is None.")
        except:
            self.fail("unique_for_date checks shouldn't explode when the associated DateField is None.")

        p = FlexibleDatePost(slug="Django 1.0")
        try:
            p.full_clean()
        except ValidationError, e:
            self.fail("unique_for_year checks shouldn't trigger when the associated DateField is None.")
        except:
            self.fail("unique_for_year checks shouldn't explode when the associated DateField is None.")

        p = FlexibleDatePost(subtitle="Finally")
        try:
            p.full_clean()
        except ValidationError, e:
            self.fail("unique_for_month checks shouldn't trigger when the associated DateField is None.")
        except:
            self.fail("unique_for_month checks shouldn't explode when the associated DateField is None.")
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/tests/modeltests/validation/test_unique.py/PerformUniqueChecksTest.test_unique_for_date_with_nullable_date