Ejemplo n.º 1
0
 def test_active_scope(self):
     sql = "SELECT * FROM `users` WHERE `users`.`name` = 'joe' AND `users`.`active` = '1'"
     self.assertEqual(sql, User.where("name", "joe").active(1).to_sql())
Ejemplo n.º 2
0
 def test_can_get_sql(self):
     sql = "SELECT * FROM `users` WHERE `users`.`name` = 'joe'"
     self.assertEqual(sql, User.where("name", "joe").to_sql())