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

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

src/d/j/django-pgfields-HEAD/tests/datetimes/tests.py   django-pgfields(Download)
        """
        dtf = DateTimeField()
        answer = dtf.to_python(1335024000)
        self.assertEqual(answer, datetime(2012, 4, 21, 16, tzinfo=pytz.UTC))
 
        """
        dtf = DateTimeField()
        answer = dtf.to_python(1335024000)
        self.assertEqual(answer, datetime(2012, 4, 21, 16))
 
        dtf = DateTimeField()
        with mock.patch.object(models.DateTimeField, 'to_python') as tp:
            dtf.to_python('2012-04-21 16:00:00+0000')
            tp.assert_called_once_with('2012-04-21 16:00:00+0000')