

def test_filtering_tags(self):
    url = '/{}registrations/?filter[tags]={}'.format(API_BASE, 'tag1')
    res = self.app.get(url, auth=self.project_one.creator.auth)
    reg_json = res.json['data']
    ids = [each['id'] for each in reg_json]
    assert_in(self.project_one_reg._id, ids)
    assert_in(self.project_two_reg._id, ids)
    assert_not_in(self.project_three_reg._id, ids)
    assert_not_in(self.private_project_user_one_reg._id, ids)
    assert_not_in(self.private_project_user_two_reg._id, ids)
    url = '/{}registrations/?filter[tags]={}&filter[tags]={}'.format(API_BASE, 'tag1', 'tag2')
    res = self.app.get(url, auth=self.project_one.creator.auth)
    reg_json = self.json['data']
    ids = [each['id'] for each in reg_json]
    assert_in(self.project_one_reg._id, ids)
    assert_not_in(self.project_two_reg._id, ids)
    assert_not_in(self.project_three_reg._id, ids)
    assert_not_in(self.private_project_user_one_reg._id, ids)
    assert_not_in(self.private_project_user_two_reg._id, ids)

dataset/ETHPy150Open CenterForOpenScience/osf.io/api_tests/registrations/views/test_registration_list.py TestRegistrationFiltering.test_filtering_tags/VarMisuse@155/233 `res`->`self`