~psycopg/psycopg/2.0.x

« back to all changes in this revision

Viewing changes to tests/types_extras.py

  • Committer: Federico Di Gregorio
  • Date: 2008-09-23 07:11:11 UTC
  • Revision ID: fog@initd.org-20080923071111-pcs5dlrk7fdnjz5g
Support for NULLs in UUID

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        u = uuid.UUID('9c6d5a77-7256-457e-9461-347b4358e350');
46
46
        s = self.execute("SELECT %s AS foo", (u,))
47
47
        self.failUnless(u == s)
 
48
        # must survive NULL cast to a uuid
 
49
        s = self.execute("SELECT NULL::uuid AS foo")
 
50
        self.failUnless(s is None)
48
51
 
49
52
def test_suite():
50
53
    return unittest.TestLoader().loadTestsFromName(__name__)