

def test_incorrect_filtering_field_not_logged_in(self):
    url = '/{}registrations/?filter[notafield]=bogus'.format(API_BASE)
    res = self.app.get(url, expect_errors=True)
    assert_equal(res.status_code, 400)
    errors = res.json['errors']
    assert_equal(len(errors), 1)
    assert_equal(errors[0]['detail'], "'notafield' is not a valid field for this endpoint.")

dataset/ETHPy150Open CenterForOpenScience/osf.io/api_tests/registrations/views/test_registration_list.py TestRegistrationFiltering.test_incorrect_filtering_field_not_logged_in/original