def METHOD_NAME(self, urls, codes, change_label=True, anon_urls=[]):
    c = Client()
    # Used to test norname urls
    c.login(username=self.username, email='tested@tested.com', password='tested')
    # Used to test with anon users
    anon_c = Client()
    def visit(pages, client):
        for url in pages:
            print(url)
            resp = client.get(url, data={"q": "tested"})
            code = resp.status_code
            if code not in codes:
                # We already know it is an error.
                # Use this to prints the url and the code.
                logger.error(f"")
                logger.error(f"Error accessing: {url}, code={code} not in expected values {codes}")
                self.assertTrue(code in codes)
    visit(pages=urls, client=c)
    visit(pages=anon_urls, client=anon_c)