~ubuntu-branches/debian/sid/sqlalchemy/sid

« back to all changes in this revision

Viewing changes to test/sql/test_delete.py

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski
  • Date: 2014-06-27 20:17:13 UTC
  • mfrom: (1.4.28)
  • Revision ID: package-import@ubuntu.com-20140627201713-g6p1kq8q1qenztrv
Tags: 0.9.6-1
* New upstream release
* Remove Python 3.X build tag files, thanks to Matthias Urlichs for the
  patch (closes: #747852)
* python-fdb isn't in the Debian archive yet so default dialect for firebird://
  URLs is changed to obsolete kinterbasdb, thanks to Russell Stuart for the
  patch (closes: #752145)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! coding:utf-8
2
2
 
3
 
from sqlalchemy import Column, Integer, String, Table, delete, select
 
3
from sqlalchemy import Column, Integer, String, Table, delete, select, and_, or_
4
4
from sqlalchemy.dialects import mysql
5
5
from sqlalchemy.testing import AssertsCompiledSQL, fixtures
6
6
 
39
39
            'WHERE mytable.myid = :myid_1 '
40
40
            'AND mytable.name = :name_1')
41
41
 
 
42
    def test_where_empty(self):
 
43
        table1 = self.tables.mytable
 
44
 
 
45
        self.assert_compile(
 
46
            table1.delete().where(and_()),
 
47
            "DELETE FROM mytable"
 
48
        )
 
49
        self.assert_compile(
 
50
            table1.delete().where(or_()),
 
51
            "DELETE FROM mytable"
 
52
        )
 
53
 
42
54
    def test_prefix_with(self):
43
55
        table1 = self.tables.mytable
44
56