コード例 #1
0
 def final_sql(self):
     return swap_params(self.sql, self.available_params())
コード例 #2
0
 def test_empty_params_does_nothing(self):
     sql = 'please swap $$this$$ and $$that$$'
     params = None
     got = swap_params(sql, params)
     self.assertEqual(got, sql)
コード例 #3
0
 def test_non_string_param_gets_swapper(self):
     sql = 'please swap $$this$$'
     expected = 'please swap 1'
     params = {'this': 1}
     got = swap_params(sql, params)
     self.assertEqual(got, expected)
コード例 #4
0
 def test_non_string_param_gets_swapper(self):
     sql = 'please swap $$this$$'
     expected = 'please swap 1'
     params = {'this': 1}
     got = swap_params(sql, params)
     self.assertEqual(got, expected)
コード例 #5
0
 def test_params_get_swapped(self):
     sql = 'please swap $$this$$ and $$that$$'
     expected = 'please swap here and there'
     params = {'this': 'here', 'that': 'there'}
     got = swap_params(sql, params)
     self.assertEqual(got, expected)
コード例 #6
0
 def test_params_get_swapped(self):
     sql = 'please Swap $$this$$ and $$THat$$'
     expected = 'please Swap here and there'
     params = {'this': 'here', 'that': 'there'}
     got = swap_params(sql, params)
     self.assertEqual(got, expected)
コード例 #7
0
 def test_empty_params_does_nothing(self):
     sql = 'please swap $$this$$ and $$that$$'
     params = None
     got = swap_params(sql, params)
     self.assertEqual(got, sql)
コード例 #8
0
ファイル: models.py プロジェクト: mkoryak/django-sql-explorer
 def final_sql(self):
     return swap_params(self.sql, self.params)
コード例 #9
0
 def final_sql(self):
     return swap_params(self.sql, self.params)
コード例 #10
0
 def final_sql(self):
     return swap_params(self.sql, self.available_params())
コード例 #11
0
 def final_sql(self, params=None):
     return swap_params(self.sql, params)
コード例 #12
0
ファイル: models.py プロジェクト: ersherr/django-sql-explorer
 def final_sql(self, params=None):
     return swap_params(self.sql, params)
コード例 #13
0
 def test_non_string_param_gets_swapper(self):
     sql = "please swap $$this$$"
     expected = "please swap 1"
     params = {"this": 1}
     got = swap_params(sql, params)
     self.assertEqual(got, expected)
コード例 #14
0
 def test_params_get_swapped(self):
     sql = "please swap $$this$$ and $$that$$"
     expected = "please swap here and there"
     params = {"this": "here", "that": "there"}
     got = swap_params(sql, params)
     self.assertEqual(got, expected)