~ubuntu-branches/debian/jessie/sqlalchemy/jessie

« back to all changes in this revision

Viewing changes to test/sql/test_quote.py

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski
  • Date: 2013-10-28 22:29:40 UTC
  • mfrom: (1.4.24)
  • Revision ID: package-import@ubuntu.com-20131028222940-wvyqffl4g617caun
Tags: 0.8.3-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
542
542
                'Foo.T1'
543
543
        )
544
544
 
 
545
    def test_quote_flag_propagate_check_constraint(self):
 
546
        m = MetaData()
 
547
        t = Table('t', m, Column('x', Integer, quote=True))
 
548
        CheckConstraint(t.c.x > 5)
 
549
        self.assert_compile(
 
550
            schema.CreateTable(t),
 
551
            "CREATE TABLE t ("
 
552
            '"x" INTEGER, '
 
553
            'CHECK ("x" > 5)'
 
554
            ")"
 
555
        )
 
556
 
 
557
    def test_quote_flag_propagate_index(self):
 
558
        m = MetaData()
 
559
        t = Table('t', m, Column('x', Integer, quote=True))
 
560
        idx = Index("foo", t.c.x)
 
561
        self.assert_compile(
 
562
            schema.CreateIndex(idx),
 
563
            'CREATE INDEX foo ON t ("x")'
 
564
        )
 
565
 
 
566
 
545
567
 
546
568
class PreparerTest(fixtures.TestBase):
547
569
    """Test the db-agnostic quoting services of IdentifierPreparer."""
596
618
        a_eq(unformat('foo.`bar`'), ['foo', 'bar'])
597
619
        a_eq(unformat('`foo`.bar'), ['foo', 'bar'])
598
620
        a_eq(unformat('`foo`.`b``a``r`.`baz`'), ['foo', 'b`a`r', 'baz'])
 
621