summaryrefslogtreecommitdiff
path: root/test/dialect/postgres.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-09-22 17:14:15 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-09-22 17:14:15 +0000
commit32dcfdf80801051971ce9638a1d9292262b375aa (patch)
tree9156fca51b61dcf02b6b5c2e8bb3543573a131cd /test/dialect/postgres.py
parent6b0a907fbdd33b9d9333ec1b72287580a2568d07 (diff)
downloadsqlalchemy-32dcfdf80801051971ce9638a1d9292262b375aa.tar.gz
- added "schema" argument to Sequence; use this with Postgres /Oracle when the sequence is
located in an alternate schema. Implements part of [ticket:584], should fix [ticket:761].
Diffstat (limited to 'test/dialect/postgres.py')
-rw-r--r--test/dialect/postgres.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/dialect/postgres.py b/test/dialect/postgres.py
index 06cebaf17..bae1f666d 100644
--- a/test/dialect/postgres.py
+++ b/test/dialect/postgres.py
@@ -5,6 +5,18 @@ from sqlalchemy import exceptions
from sqlalchemy.databases import postgres
from testlib import *
+class SequenceTest(SQLCompileTest):
+ def test_basic(self):
+ seq = Sequence("my_seq_no_schema")
+ dialect = postgres.PGDialect()
+ assert dialect.identifier_preparer.format_sequence(seq) == "my_seq_no_schema"
+
+ seq = Sequence("my_seq", schema="some_schema")
+ assert dialect.identifier_preparer.format_sequence(seq) == "some_schema.my_seq"
+
+ seq = Sequence("My_Seq", schema="Some_Schema")
+ assert dialect.identifier_preparer.format_sequence(seq) == '"Some_Schema"."My_Seq"'
+
class InsertTest(AssertMixin):
@testing.supported('postgres')
def setUpAll(self):