def test_list_callbacks__filtered(self): url = ( "{}/events/account/{}/events/callbacks?search[event]=estimate.create" ).format(API_BASE_URL, self.account_id) httpretty.register_uri( httpretty.GET, url, body=json.dumps(get_fixture("list_callbacks_response")), status=200 ) filter = FilterBuilder() filter.equals("event", "estimate.create") self.freshBooksClient.callbacks.list(self.account_id, builders=[filter]) expected_params = {"search[event]": ["estimate.create"]} assert httpretty.last_request().querystring == expected_params
def test_equals__resource_not_specified(self): filter = FilterBuilder() filter.equals("username", "Bob") assert filter.build() == "&search[username]=Bob"
def test_equals__project(self): filter = FilterBuilder() filter.equals("username", "Bob") assert filter.build("ProjectResource") == "&username=Bob"
def test_equals__accounting(self): filter = FilterBuilder() filter.equals("username", "Bob") assert filter.build("AccountingResource") == "&search[username]=Bob"