Refactored filter logic and added human descriptions - refs #86

This commit is contained in:
Simon Willison 2017-11-19 22:03:24 -08:00
commit b4e6211a97
No known key found for this signature in database
GPG key ID: FBB38AFE227189DB
4 changed files with 108 additions and 50 deletions

View file

@ -100,7 +100,8 @@ def test_custom_json_encoder(obj, expected):
),
])
def test_build_where(args, expected_where, expected_params):
sql_bits, actual_params = utils.build_where_clauses(args)
f = utils.Filters(sorted(args.items()))
sql_bits, actual_params = f.build_where_clauses()
assert expected_where == sql_bits
assert {
'p{}'.format(i): param