diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-11-23 19:32:41 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-11-23 19:32:41 -0500 |
| commit | d1bf4d2b863ef71cc936977a9fee1a5b056aff67 (patch) | |
| tree | d53c4deb753baeafe0ce28b0142b939132dc3ea6 /test/sql/test_quote.py | |
| parent | 66c5bc6c7094b39c1599c3bc074f9a15a52cb3c6 (diff) | |
| download | sqlalchemy-d1bf4d2b863ef71cc936977a9fee1a5b056aff67.tar.gz | |
- adjust this test for the ugly reality of the "name normalize" backends, where because we've decided
that "lowercase" is the case insensitive casing, we can't distinguish between case insensitive/not
on a database that returns case-insensitive names as UPPERCASE, for names that are UPPERCASE.
[ticket:2615]
Diffstat (limited to 'test/sql/test_quote.py')
| -rw-r--r-- | test/sql/test_quote.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/test/sql/test_quote.py b/test/sql/test_quote.py index 50a8a414b..8b14d23a9 100644 --- a/test/sql/test_quote.py +++ b/test/sql/test_quote.py @@ -43,10 +43,24 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL): meta2 = MetaData(testing.db) t2 = Table('WorstCase1', meta2, autoload=True, quote=True) assert 'lowercase' in t2.c - assert 'UPPERCASE' in t2.c - assert 'MixedCase' in t2.c + + # indicates the DB returns unquoted names as + # UPPERCASE, which we then assume are unquoted and go to + # lower case. So we cannot accurately reflect quoted UPPERCASE + # names from a "name normalize" backend, as they cannot be + # distinguished from case-insensitive/unquoted names. + if testing.db.dialect.requires_name_normalize: + assert 'uppercase' in t2.c + else: + assert 'UPPERCASE' in t2.c + + # ASC OTOH is a reserved word, which is always quoted, so + # with that name we keep the quotes on and it stays uppercase + # regardless. Seems a little weird, though. assert 'ASC' in t2.c + assert 'MixedCase' in t2.c + def test_basic(self): table1.insert().execute( {'lowercase': 1, 'UPPERCASE': 2, 'MixedCase': 3, 'a123': 4}, |
