MCPcopy
hub / github.com/django/django / test_unicode_date

Method test_unicode_date

tests/gis_tests/geoapp/test_regress.py:54–68  ·  view source on GitHub ↗

Testing dates are converted properly, even on SpatiaLite. See #16408.

(self)

Source from the content-addressed store, hash-verified

52 self.assertAlmostEqual(ref_val, val, 4)
53
54 def test_unicode_date(self):
55 "Testing dates are converted properly, even on SpatiaLite. See #16408."
56 founded = datetime(1857, 5, 23)
57 PennsylvaniaCity.objects.create(
58 name="Mansfield",
59 county="Tioga",
60 point="POINT(-77.071445 41.823881)",
61 founded=founded,
62 )
63 self.assertEqual(
64 founded, PennsylvaniaCity.objects.datetimes("founded", "day")[0]
65 )
66 self.assertEqual(
67 founded, PennsylvaniaCity.objects.aggregate(Min("founded"))["founded__min"]
68 )
69
70 @skipUnlessGISLookup("contains")
71 def test_empty_count(self):

Callers

nothing calls this directly

Calls 4

MinClass · 0.90
datetimesMethod · 0.80
aggregateMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected