summaryrefslogtreecommitdiff
path: root/tests/test_parse.py
diff options
context:
space:
mode:
authorFredy Wijaya <fredy.wijaya@gmail.com>2018-03-21 23:01:17 -0500
committerFredy Wijaya <fredy.wijaya@gmail.com>2018-03-21 23:04:40 -0500
commite07e09540d056f2fad0f18acfb8196b42c2ace66 (patch)
treebcfb2bf693bb380c81071f0b02cc874a5f2ff6a0 /tests/test_parse.py
parent19b9e6756c796752565950d89598ef8b46ca786d (diff)
downloadsqlparse-e07e09540d056f2fad0f18acfb8196b42c2ace66.tar.gz
Fix issue with get_real_name returning incorrect name
Diffstat (limited to 'tests/test_parse.py')
-rw-r--r--tests/test_parse.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index b6f4fff..30be32b 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -424,3 +424,12 @@ def test_non_ascii():
statement = stmts[0]
assert text_type(statement) == _test_non_ascii
assert statement._pprint_tree() is None
+
+
+def test_get_real_name():
+ # issue 369
+ s = u"update a t set t.b=1"
+ stmts = sqlparse.parse(s)
+ assert len(stmts) == 1
+ assert 'a' == stmts[0].get_real_name()
+ assert 't' == stmts[0].get_alias()