'Tests the where clause creation'

def test_query_expression_where_clause_generation(self):

    query1 = self.table.objects((self.table.column('test_id') == 5))
    self.assertEqual(len(query1._where), 1)
    where = query1._where[0]
    self.assertEqual(where.field, 'test_id')
    self.assertEqual(where.value, 5)
    query2 = query1.filter((self.table.column('expected_result') >= 1))
    self.assertEqual(len(query2._where), 2)
    where = query2._where[0]
    self.assertEqual(where.field, 'test_id')
    self.assertIsInstance(where.operator, EqualsOperator)
    self.assertEqual(where.value, 5)
    where = query2._where[1]
    self.assertEqual(where.field, 'expected_result')
    self.assertIsInstance(where.operator, GreaterThanOrEqualOperator)
    self.assertEqual(where.value, 1)
