Mike Bayer avatar Mike Bayer committed 8c43e14

- 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]

Comments (0)

Files changed (1)

test/sql/test_quote.py

         meta2 = MetaData(testing.db)
         t2 = Table('WorstCase1', meta2, autoload=True, quote=True)
         assert 'lowercase' in t2.c
-        assert 'UPPERCASE' 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
-        assert 'ASC' in t2.c
 
     def test_basic(self):
         table1.insert().execute(
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.