Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)

src/d/j/django-cached-modelforms-0.2.1/cached_modelforms/tests/test_fields.py   django-cached-modelforms(Download)
        '''
        # some value
        form = self.FormSingle({'obj': unicode(self.obj1.pk)})
        self.assertTrue(form.is_valid())
        self.assertEqual(form.cleaned_data['obj'], self.obj1)
 
        # no value
        form = self.FormSingle({})
 
        # invalid value
        form = self.FormSingle({'obj': u'-1'})
        self.assertFalse(form.is_valid())
        self.assertTrue(form._errors['obj'])

src/d/j/django-cached-modelforms-HEAD/cached_modelforms/tests/test_fields.py   django-cached-modelforms(Download)
        '''
        # some value
        form = self.FormSingle({'obj': unicode(self.obj1.pk)})
        self.assertTrue(form.is_valid())
        self.assertEqual(form.cleaned_data['obj'], self.obj1)
 
        # no value
        form = self.FormSingle({})
 
        # invalid value
        form = self.FormSingle({'obj': u'-1'})
        self.assertFalse(form.is_valid())
        self.assertTrue(form._errors['obj'])