~fluiddb-dev/storm/trunk

« back to all changes in this revision

Viewing changes to tests/databases/postgres.py

  • Committer: Jamu Kakar
  • Date: 2011-02-25 10:26:26 UTC
  • Revision ID: jkakar@kakar.ca-20110225102626-366zr2hm5qguzhgy
- Reverted unnecessary changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#
21
21
from datetime import date, time, timedelta
22
22
import os
23
 
from uuid import uuid4
24
23
 
25
24
from storm.databases.postgres import (
26
25
    Postgres, compile, currval, Returning, PostgresTimeoutTracer)
28
27
from storm.exceptions import InterfaceError, ProgrammingError
29
28
from storm.variables import DateTimeVariable, RawStrVariable
30
29
from storm.variables import ListVariable, IntVariable, Variable
31
 
from storm.properties import Int, UUID
 
30
from storm.properties import Int
32
31
from storm.expr import (Union, Select, Insert, Alias, SQLRaw, State,
33
32
                        Sequence, Like, Column, COLUMN)
34
33
from storm.tracer import install_tracer, TimeoutError
36
35
# We need the info to register the 'type' compiler.  In normal
37
36
# circumstances this is naturally imported.
38
37
import storm.info
39
 
from storm.info import get_cls_info
40
38
 
41
39
from tests.databases.base import (
42
40
    DatabaseTest, DatabaseDisconnectionTest, UnsupportedDatabaseTest)
68
66
        self.connection.execute("CREATE TABLE insert_returning_test "
69
67
                                "(id1 INTEGER DEFAULT 123, "
70
68
                                " id2 INTEGER DEFAULT 456)")
71
 
        self.connection.execute("CREATE TABLE uuid_test"
72
 
                                "(id UUID PRIMARY KEY)")
73
69
 
74
70
    def drop_tables(self):
75
71
        super(PostgresTest, self).drop_tables()
76
 
        for table in ["like_case_insensitive_test", "insert_returning_test",
77
 
                      "uuid_test"]:
 
72
        for table in ["like_case_insensitive_test", "insert_returning_test"]:
78
73
            try:
79
74
                self.connection.execute("DROP TABLE %s" % table)
80
75
                self.connection.commit()