示例#1
0
    def test_joinMultipleWheres(self):
        yield User(first_name="First", last_name="Last", age=20).save()

        first = ['first_name = ?', "First"]
        last = ['last_name = ?', "Last"]
        age = ['age <> ?', 20]

        where = utils.joinMultipleWheres([first, last, age], joiner='AND')

        results = yield User.count(where=where)
        self.assertEqual(1, results)
示例#2
0
    def test_joinMultipleWheres(self):
        yield User(first_name="First", last_name="Last", age=20).save()

        first = ['first_name = ?', "First"]
        last = ['last_name = ?', "Last"]
        age = ['age <> ?', 20]

        where = utils.joinMultipleWheres([first, last, age], joiner='AND')

        results = yield User.count(where=where)
        self.assertEqual(1, results)
示例#3
0
 def test_joinMultipleWheres_single_where(self):
     where = ['first_name = ?', "First"]
     joined_where = utils.joinMultipleWheres([where], joiner='AND')
     self.assertEqual(where, joined_where)
示例#4
0
 def test_joinMultipleWheres_empty_arg(self):
     where = utils.joinMultipleWheres([], joiner='AND')
     self.assertEqual(where, [])
示例#5
0
 def test_joinMultipleWheres_single_where(self):
     where = ['first_name = ?', "First"]
     joined_where = utils.joinMultipleWheres([where], joiner='AND')
     self.assertEqual(where, joined_where)
示例#6
0
 def test_joinMultipleWheres_empty_arg(self):
     where = utils.joinMultipleWheres([], joiner='AND')
     self.assertEqual(where, [])