def testSetDatestyle(self): datestyle = pg.get_datestyle() try: pg.set_datestyle('ISO, YMD') self.assertEqual(pg.get_datestyle(), 'ISO, YMD') pg.set_datestyle('Postgres, MDY') self.assertEqual(pg.get_datestyle(), 'Postgres, MDY') pg.set_datestyle('Postgres, DMY') self.assertEqual(pg.get_datestyle(), 'Postgres, DMY') pg.set_datestyle('SQL, MDY') self.assertEqual(pg.get_datestyle(), 'SQL, MDY') pg.set_datestyle('SQL, DMY') self.assertEqual(pg.get_datestyle(), 'SQL, DMY') pg.set_datestyle('German, DMY') self.assertEqual(pg.get_datestyle(), 'German, DMY') pg.set_datestyle(None) self.assertIsNone(pg.get_datestyle()) finally: pg.set_datestyle(datestyle)
def testGetDatestyle(self): datestyle = pg.get_datestyle() try: pg.set_datestyle('ISO, YMD') self.assertEqual(pg.get_datestyle(), 'ISO, YMD') pg.set_datestyle('Postgres, MDY') self.assertEqual(pg.get_datestyle(), 'Postgres, MDY') pg.set_datestyle('Postgres, DMY') self.assertEqual(pg.get_datestyle(), 'Postgres, DMY') pg.set_datestyle('SQL, MDY') self.assertEqual(pg.get_datestyle(), 'SQL, MDY') pg.set_datestyle('SQL, DMY') self.assertEqual(pg.get_datestyle(), 'SQL, DMY') pg.set_datestyle('German, DMY') self.assertEqual(pg.get_datestyle(), 'German, DMY') pg.set_datestyle(None) self.assertIsNone(pg.get_datestyle()) finally: pg.set_datestyle(datestyle)
def testGetDatestyle(self): self.assertIsNone(pg.get_datestyle())