File: test_quote.py

package info (click to toggle)
python-sqlalchemy-utils 0.41.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,252 kB
  • sloc: python: 13,566; makefile: 141
file content (19 lines) | stat: -rw-r--r-- 651 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from sqlalchemy.dialects import postgresql

from sqlalchemy_utils.functions import quote


class TestQuote:
    def test_quote_with_preserved_keyword(self, connection, session):
        assert quote(connection, 'order') == '"order"'
        assert quote(session, 'order') == '"order"'
        assert quote(postgresql.dialect(), 'order') == '"order"'

    def test_quote_with_non_preserved_keyword(
        self,
        connection,
        session
    ):
        assert quote(connection, 'some_order') == 'some_order'
        assert quote(session, 'some_order') == 'some_order'
        assert quote(postgresql.dialect(), 'some_order') == 'some_order'