コード例 #1
0
 def test_get_params_for_request(self):
     q = SimpleQueryFactory(params={'a': 1, 'b': 2})
     # For some reason the order of the params is non-deterministic, causing the following to periodically fail:
     #     self.assertEqual(get_params_for_url(q), 'a:1|b:2')
     # So instead we go for the following, convoluted, asserts:
     res = get_params_for_url(q)
     res = res.split('|')
     expected = ['a:1', 'b:2']
     for e in expected:
         self.assertIn(e, res)
コード例 #2
0
 def test_get_params_for_request(self):
     q = SimpleQueryFactory(params={'a': 1, 'b': 2})
     # For some reason the order of the params is non-deterministic, causing the following to periodically fail:
     #     self.assertEqual(get_params_for_url(q), 'a:1|b:2')
     # So instead we go for the following, convoluted, asserts:
     res = get_params_for_url(q)
     res = res.split('|')
     expected = ['a:1', 'b:2']
     for e in expected:
         self.assertIn(e, res)
コード例 #3
0
 def params_for_url(self):
     return get_params_for_url(self)
コード例 #4
0
ファイル: test_utils.py プロジェクト: uktrade/data-explorer
 def test_get_params_for_request_empty(self):
     q = SimpleQueryFactory()
     self.assertEqual(get_params_for_url(q), None)
コード例 #5
0
 def test_get_params_for_request_empty(self):
     q = SimpleQueryFactory()
     self.assertEqual(get_params_for_url(q), None)
コード例 #6
0
ファイル: models.py プロジェクト: groveco/django-sql-explorer
 def params_for_url(self):
     return get_params_for_url(self)