Example #1
0
    def check_forbid_anonymous_upload(self) -> CheckResult:
        opener = urllib.request.build_opener()
        try:
            upload_page_response = opener.open(
                f'http://localhost:{self.port}/tube/upload/')
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the upload page.')

        upload_page = upload_page_response.read()

        csrf_options = re.findall(self.CSRF_PATTERN, upload_page)
        if not csrf_options:
            return CheckResult.true()

        title = 'Test Video'

        new_video = {
            'title': title,
            'tags': 'testtag',
            'csrfmiddlewaretoken': csrf_options[0],
        }
        files = {'video': open(UPLOADING_FILE_NAME, 'rb')}

        upload_response = requests.post(
            f'http://localhost:{self.port}/tube/upload/',
            files=files,
            data=new_video)

        if upload_response.status_code != 403:
            return CheckResult.false(
                'Should not allow anonymous users upload video')

        return CheckResult.true()
 def check(self, reply, attach):
     if "internet connection" in reply.lower():
         return CheckResult.true()
     if 'unable' in reply.lower():
         return CheckResult.true()
     return CheckResult.false(
         'You did not hand exception with imagine word. If translator cannot translate word, you should show it\nOr You did not hand exception with internet connection'
     )
Example #3
0
    def check(self, reply, attach):
        if 'support korean' in reply.lower():
            return CheckResult.true()
        if 'internet connection' in reply.lower():
            return CheckResult.true()

        return CheckResult.false(
            'You did not correctly write that your program did not support korean or You did not hand exception with internet connection'
        )
Example #4
0
    def check_main_page_video_links(self):
        connection = sqlite3.connect(TEST_DATABASE)
        cursor = connection.cursor()
        try:
            cursor.execute('SELECT `id`, `title` FROM tube_video')
            videos = cursor.fetchall()
        except sqlite3.DatabaseError as err:
            return CheckResult.false(str(err))

        video_links_with_titles_from_db = [(f'/tube/watch/{x[0]}/', x[1])
                                           for x in videos]

        try:
            page = self.read_page(f'http://localhost:{self.port}/tube/')
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the main page.')

        links_from_page = re.findall(self.LINK_WITH_TEXT_PATTERN, page, re.S)
        links_from_page = self.__stripped_list_with_tuple(links_from_page)

        for video_link in video_links_with_titles_from_db:
            if video_link not in links_from_page:
                return CheckResult.false(
                    'Main page should contain <a> element with href '
                    '/tube/watch/{id}/ and title as link text')

        return CheckResult.true()
Example #5
0
    def check_signup(self) -> CheckResult:
        opener = urllib.request.build_opener(
            urllib.request.HTTPCookieProcessor(self.cookie_jar)
        )
        try:
            response = opener.open(f'http://localhost:{self.port}/signup')
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the signup page.')

        csrf_options = re.findall(
            b'<input[^>]+value="(?P<csrf>\w+)"[^>]*>', response.read()
        )
        if not csrf_options:
            return CheckResult.false('Missing csrf_token in the form')

        try:
            response = opener.open(
                f'http://localhost:{self.port}/signup',
                data=urllib.parse.urlencode({
                    'csrfmiddlewaretoken': csrf_options[0],
                    'username': self.USERNAME,
                    'password1': self.PASSWORD,
                    'password2': self.PASSWORD,
                }).encode()
            )
            if f'login' in response.url:
                return CheckResult.true()
            return CheckResult.false('Cannot signup: problems with form')
        except urllib.error.URLError as err:
            return CheckResult.false(f'Cannot signup: {err.reason}')
Example #6
0
    def check_create_resume_from_profile(self) -> CheckResult:
        opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(self.cookie_jar))
        try:
            response = opener.open(f'http://localhost:{self.port}/home')
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the home page.')

        csrf_options = re.findall(
            b'<input[^>]+value="(?P<csrf>\w+)"[^>]*>', response.read()
        )
        if not csrf_options:
            return CheckResult.false('Missing csrf_token in the form')

        try:
            response = opener.open(
                f'http://localhost:{self.port}/resume/new',
                data=urllib.parse.urlencode({
                    'description': self.OCCUPATION,
                    'csrfmiddlewaretoken': csrf_options[0],
                }).encode()
            )
        except urllib.error.URLError as err:
            return CheckResult.false(f'Cannot create resume: {err.reason}')

        try:
            page = self.read_page(f'http://localhost:{self.port}/resumes')
            description = f'{self.USERNAME}: {self.OCCUPATION}'
            if description not in page:
                return CheckResult.false(
                    f'Resumes page does not contain newly created resume'
                )
            return CheckResult.true()
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the resumes page.')
Example #7
0
    def check_create_resumes(self) -> CheckResult:
        connection = sqlite3.connect(TEST_DATABASE)
        cursor = connection.cursor()
        try:
            cursor.executemany(
                'INSERT INTO auth_user '
                '(`id`, `username`, `email`, `is_staff`, `password`, `is_superuser`, '
                '`first_name`, `last_name`, `is_active`, `date_joined`) '
                'VALUES (?, ?, ?, ?, "", 0, "", "", 1, datetime())',
                INITIAL_USERS[len(INITIAL_VACANCIES):]
            )
            cursor.executemany(
                'INSERT INTO resume_resume (`author_id`, `description`) VALUES (?, ?)',
                INITIAL_RESUMES
            )
            connection.commit()

            cursor.execute('SELECT `author_id`, `description` FROM resume_resume')
            result = cursor.fetchall()

            for item in INITIAL_RESUMES:
                if item not in result:
                    return CheckResult.false('Check your Resume model')
            return CheckResult.true()

        except sqlite3.DatabaseError as err:
            return CheckResult.false(str(err))
Example #8
0
    def check_news_page(self) -> CheckResult:
        self.__setup()
        testing_news = self.news_data[0]
        link = testing_news['link']
        created = testing_news['created']

        try:
            page = self.read_page(f'http://localhost:{self.port}/news/{link}/')
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the news page.')

        page_headers = re.findall(self.H2_PATTERN, page, re.S)
        page_headers = self.__stripped_list(page_headers)
        page_paragraphs = re.findall(self.PARAGRAPH_PATTERN, page, re.S)
        page_paragraphs = self.__stripped_list(page_paragraphs)
        if testing_news['title'] not in page_headers:
            return CheckResult.false(
                'News page should contain <h2> element with the data '
                'of the title field from json file.')

        if testing_news['text'] not in page_paragraphs:
            return CheckResult.false(
                'News page should contain <p> element with the data '
                'of the text field from json file.')

        if created not in page_paragraphs:
            return CheckResult.false(
                'News page should contain <p> element with the data '
                'of the created field from json file '
                'in the format: "%Y-%m-%d %H:%M:%S".')

        return CheckResult.true()
Example #9
0
    def check_coming_soon_page(self) -> CheckResult:
        self.__setup()
        try:
            page = self.read_page(f'http://localhost:{self.port}/')
        except urllib.error.URLError:
            return CheckResult.false(
                'Cannot connect to the "Coming soon" page.')

        opener = urllib.request.build_opener(
            urllib.request.HTTPCookieProcessor(self.cookie_jar))
        try:
            response = opener.open(f'http://localhost:{self.port}/')
        except urllib.error.URLError:
            return CheckResult.false(
                'Cannot connect to the "Coming soon" page.')

        coming_soon_text = 'Coming soon'

        # response.url for the backward compatibility
        if (coming_soon_text not in page
                and response.url != f'http://localhost:{self.port}/news/'):
            return CheckResult.false(
                '"Coming soon" page should contain "Coming soon" text')

        return CheckResult.true()
Example #10
0
    def check_main_page_video_count(self):
        connection = sqlite3.connect(TEST_DATABASE)
        cursor = connection.cursor()
        try:
            cursor.execute('SELECT count(*) FROM tube_video')
            video_count = str(cursor.fetchall()[0][0])
        except sqlite3.DatabaseError as err:
            return CheckResult.false(str(err))

        try:
            page = self.read_page(f'http://localhost:{self.port}/tube/')
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the main page.')

        paragraphs_from_page = re.findall(self.PARAGRAPH_PATTERN, page, re.S)
        paragraphs_from_page = self.__stripped_list(paragraphs_from_page)

        quantity_in_paragraphs = False
        for paragraph in paragraphs_from_page:
            if video_count in paragraph:
                quantity_in_paragraphs = True
                break

        if not quantity_in_paragraphs:
            return CheckResult.false(
                f'Main page should contain <p> element with quantity of videos'
            )

        return CheckResult.true()
Example #11
0
 def check(self, reply, attach):
     if 'french translations' in reply.lower(
     ) and 'french examples' in reply.lower():
         return CheckResult.true()
     return CheckResult.false(
         "Test failed. Maybe threre is a mistake in command line args or in output.\n\
      if args==['english', 'french', 'hello'], you should print 'french translations', 'french examples' and so on"
     )
 def check(self, reply, attach):
     with open('hello.txt') as file:
         output = file.read().lower()
         if 'spanish translation' in output and 'spanish example' in output and 'turkish example' in output:
             return CheckResult.true()
     return CheckResult.false(
         'Test failed. Try to write all translations and examples into the output file and name it WORD.txt where WORD is word you want to translate.'
     )
Example #13
0
    def check_main_page_search(self):
        self.__setup()
        q = '2'
        news_data = copy.deepcopy(self.news_data)

        for news in news_data:
            created_date = datetime.strptime(news['created'],
                                             '%Y-%m-%d %H:%M:%S') \
                .date()
            news['created_date_str'] = created_date.strftime('%Y-%m-%d')

        all_headers = set((x['created_date_str'] for x in news_data))
        visible_headers = set((x['created_date_str'] for x in news_data
                               if q in x['title']))
        invisible_headers = all_headers - visible_headers
        visible_titles = [x['title'] for x in news_data
                          if q in x['title']]
        invisible_titles = [x['title'] for x in news_data
                            if q not in x['title']]

        try:
            page = self.read_page(f'http://localhost:{self.port}/news/?q={q}')
        except urllib.error.URLError:
            return CheckResult.false(
                'Cannot connect to the search page.'
            )

        h4_headers = re.findall(self.H4_PATTERN, page, re.S)
        h4_headers = self.__stripped_list(h4_headers)

        for header in visible_headers:
            if header not in h4_headers:
                return CheckResult.false(
                    f'Search page should contain headers with found news'
                )

        for header in invisible_headers:
            if header in h4_headers:
                return CheckResult.false(
                    f'Search page should not contain headers with unfound news'
                )

        titles = re.findall(self.TEXT_LINK_PATTERN, page, re.S)
        titles = self.__stripped_list(titles)

        for title in visible_titles:
            if title not in titles:
                return CheckResult.false(
                    f'Search page should contain unfound news'
                )

        for title in invisible_titles:
            if title in titles:
                return CheckResult.false(
                    f'Search page should contain found news'
                )

        return CheckResult.true()
Example #14
0
 def check_greeting(self) -> CheckResult:
     try:
         main_page = self.read_page(f'http://localhost:{self.port}')
         if 'Welcome to HyperJob!' in main_page:
             return CheckResult.true()
         return CheckResult.false(
             'Main page should contain "Welcome to HyperJob!" line')
     except urllib.error.URLError:
         return CheckResult.false('Cannot connect to the menu page.')
Example #15
0
    def check_server(self):
        if self.port == '0':
            return CheckResult.false(
                f'Please free one of the ports: {", ".join(self.tryout_ports)}'
            )

        for _ in range(15):
            try:
                urlopen(
                    f'http://localhost:{self.port}/not-existing-link-by-default'
                )
                return CheckResult.true()
            except URLError as err:
                if isinstance(err, HTTPError):
                    return CheckResult.true()
                sleep(1)
        else:
            return CheckResult.false(
                'Cannot start the ./manage.py runserver for 15 seconds')
Example #16
0
 def get_welcome_page(self) -> CheckResult:
     try:
         main_page = self.read_page(f'http://localhost:{self.port}/welcome')
         if 'Welcome to the Hypercar Service!' in main_page:
             return CheckResult.true()
         return CheckResult.false(
             'Main page should contain "Welcome to the Hypercar Service!" line'
         )
     except URLError:
         return CheckResult.false('Cannot connect to the /welcome page.')
Example #17
0
    def check(self, reply, attach):

        if 'arabic translations' in reply.lower(
        ) and 'arabic examples' in reply.lower(
        ) and 'russian examples' in reply.lower(
        ) and 'russian examples' in reply.lower():
            return CheckResult.true()
        return CheckResult.false(
            'Try to print translations and examples of all languages you can. Try to print "Arabic Translations" or "Arabic Examples" and other languages should be printed in this style'
        )
Example #18
0
    def check_uploading_video(self):
        opener = urllib.request.build_opener(
            urllib.request.HTTPCookieProcessor(self.cookie_jar))
        try:
            upload_page_response = opener.open(
                f'http://localhost:{self.port}/tube/upload/')
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the upload page.')

        upload_page = upload_page_response.read()

        csrf_options = re.findall(self.CSRF_PATTERN, upload_page)

        if not csrf_options:
            return CheckResult.false(
                'Missing csrf_token in the upload page form')

        new_video = {
            'title': self.TITLE,
            'tags': self.TAG,
            'csrfmiddlewaretoken': csrf_options[0],
        }
        files = {'video': open(UPLOADING_FILE_NAME, 'rb')}

        upload_response = requests.post(
            f'http://localhost:{self.port}/tube/upload/',
            cookies=self.cookie_jar,
            files=files,
            data=new_video)

        if upload_response.url != f'http://localhost:{self.port}/tube/':
            self.__delete_all_test_files()
            return CheckResult.false(
                'After uploading video handler should redirects to the /tube/ '
                'page')

        connection = sqlite3.connect(TEST_DATABASE)
        cursor = connection.cursor()
        try:
            cursor.execute(
                f"SELECT count(*) FROM tube_video WHERE title = '{self.TITLE}'"
            )
            videos = cursor.fetchall()
        except sqlite3.DatabaseError as err:
            self.__delete_all_test_files()
            return CheckResult.false(str(err))

        if videos[0][0] != 1:
            self.__delete_all_test_files()
            return CheckResult.false(
                'After uploading video data doesn\'t saved in database')

        self.__delete_all_test_files()
        return CheckResult.true()
Example #19
0
 def check_vacancies(self) -> CheckResult:
     try:
         page = self.read_page(f'http://localhost:{self.port}/vacancies')
         for person, vacancy in zip(INITIAL_USERS, INITIAL_VACANCIES):
             description = f'{person[1]}: {vacancy[1]}'
             if description not in page:
                 return CheckResult.false(
                     f'Vacancies page should contain vacancies in form <username>: <description>'
                 )
         return CheckResult.true()
     except urllib.error.URLError:
         return CheckResult.false('Cannot connect to the vacancies page.')
Example #20
0
    def check_main_page_tag_filtering(self):
        tag = 'sport'
        connection = sqlite3.connect(TEST_DATABASE)
        cursor = connection.cursor()
        try:
            cursor.execute(
                f"SELECT tube_video.id, tube_video.title FROM tube_video "
                f"JOIN tube_videotag ON tube_video.id = tube_videotag.video_id "
                f"JOIN tube_tag ON tube_videotag.tag_id = tube_tag.id "
                f"WHERE tube_tag.name = '{tag}'")
            visible_videos = cursor.fetchall()
        except sqlite3.DatabaseError as err:
            return CheckResult.false(str(err))

        visible_video_links_with_titles_from_db = \
            [(f'/tube/watch/{x[0]}/', x[1]) for x in visible_videos]

        try:
            cursor.execute(
                f"SELECT tv.id, tv.title FROM tube_video tv "
                f"WHERE NOT EXISTS (SELECT 1 FROM tube_video "
                f"JOIN tube_videotag ON tube_video.id = tube_videotag.video_id "
                f"JOIN tube_tag ON tube_videotag.tag_id = tube_tag.id "
                f"WHERE tube_tag.name = '{tag}' AND tv.id = tube_video.id)")
            invisible_videos = cursor.fetchall()
        except sqlite3.DatabaseError as err:
            return CheckResult.false(str(err))

        invisible_video_links_with_titles_from_db = \
            [(f'/tube/watch/{x[0]}/', x[1]) for x in invisible_videos]

        try:
            page = self.read_page(
                f'http://localhost:{self.port}/tube/?tag={tag}')
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the main page.')

        links_from_page = re.findall(self.LINK_WITH_TEXT_PATTERN, page, re.S)
        links_from_page = self.__stripped_list_with_tuple(links_from_page)

        for video_link in visible_video_links_with_titles_from_db:
            if video_link not in links_from_page:
                return CheckResult.false(
                    'Main page should contain links with found videos when '
                    'filtering with tags')

        for video_link in invisible_video_links_with_titles_from_db:
            if video_link in links_from_page:
                return CheckResult.false(
                    'Main page should not contain links with unfound videos '
                    'when filtering with tags')

        return CheckResult.true()
Example #21
0
    def check_forbid_to_create_vacancy(self) -> CheckResult:
        opener = urllib.request.build_opener(
            urllib.request.HTTPCookieProcessor(self.cookie_jar))
        try:
            response = opener.open(f'http://localhost:{self.port}/home')
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the home page.')

        csrf_options = re.findall(b'<input[^>]+value="(?P<csrf>\w+)"[^>]*>',
                                  response.read())
        if not csrf_options:
            return CheckResult.true()

        OTHER_OCCUPATION = 'Marketing Coordinator'

        try:
            response = opener.open(f'http://localhost:{self.port}/vacancy/new',
                                   data=urllib.parse.urlencode({
                                       'description':
                                       OTHER_OCCUPATION,
                                       'csrfmiddlewaretoken':
                                       csrf_options[0],
                                   }).encode())
            return CheckResult.false(
                'Should not allow usual users create vacancies')
        except urllib.error.URLError as err:
            if 'Forbidden' not in err.reason:
                return CheckResult.false(
                    f'Wrong response for forbidden requests: {err.reason}')

        try:
            page = self.read_page(f'http://localhost:{self.port}/vacancies')
            if OTHER_OCCUPATION in page:
                return CheckResult.false(
                    f'Vacancies page should not contain vacancies from usual users'
                )
            return CheckResult.true()
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the vacancies page.')
Example #22
0
 def check_resumes(self) -> CheckResult:
     try:
         page = self.read_page(f'http://localhost:{self.port}/resumes')
         for person, resume in zip(INITIAL_USERS[len(INITIAL_VACANCIES):],
                                   INITIAL_RESUMES):
             description = f'{person[1]}: {resume[1]}'
             if description not in page:
                 return CheckResult.false(
                     f'Resumes page should contain resumes in form <username>: <description>'
                 )
         return CheckResult.true()
     except urllib.error.URLError:
         return CheckResult.false('Cannot connect to the resumes page.')
Example #23
0
 def get_ticket(self, service: str, content: str,
                helper_msg: str) -> CheckResult:
     try:
         page = self.read_page(
             f'http://localhost:{self.port}/get_ticket/{service}')
         if content in page:
             return CheckResult.true()
         else:
             return CheckResult.false(
                 f'Expected to have {content} on /get_ticket/{service} page after\n'
                 f'{helper_msg}')
     except URLError:
         return CheckResult.false(
             f'Cannot connect to the /get_ticket/{service} page.')
Example #24
0
    def check_main_page_login_link(self):
        login_link = '/login/'
        try:
            page = self.read_page(f'http://localhost:{self.port}/tube/')
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the main page.')

        links_from_page = re.findall(self.COMMON_LINK_PATTERN, page, re.S)
        links_from_page = self.__stripped_list(links_from_page)

        if login_link not in links_from_page:
            return CheckResult.false(
                f'Main page should contain <a> element with href {login_link}')

        return CheckResult.true()
Example #25
0
 def get_client_menu_page(self) -> CheckResult:
     try:
         page = self.read_page(f'http://localhost:{self.port}/menu')
         links = re.findall(self.ELEMENT_PATTERN, page)
         for link in (
                 '/get_ticket/change_oil',
                 '/get_ticket/inflate_tires',
                 '/get_ticket/diagnostic',
         ):
             if link not in links:
                 return CheckResult.false(
                     f'Menu page should contain <a> element with href {link}'
                 )
         return CheckResult.true()
     except URLError:
         return CheckResult.false('Cannot connect to the /menu page.')
Example #26
0
    def check_main_header(self) -> CheckResult:
        self.__setup()
        try:
            page = self.read_page(f'http://localhost:{self.port}/news/')
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the main page.')

        h2_headers = re.findall(self.H2_PATTERN, page, re.S)
        h2_headers = self.__stripped_list(h2_headers)
        main_header = 'Hyper news'

        if main_header not in h2_headers:
            return CheckResult.false(
                'Main page should contain <h2> element with text "Hyper news"')

        return CheckResult.true()
Example #27
0
    def check_coming_soon_page_redirect(self) -> CheckResult:
        self.__setup()

        opener = urllib.request.build_opener(
            urllib.request.HTTPCookieProcessor(self.cookie_jar))
        try:
            response = opener.open(f'http://localhost:{self.port}/')
        except urllib.error.URLError:
            return CheckResult.false(
                'Cannot connect to the "Coming soon" page.')

        if response.url != f'http://localhost:{self.port}/news/':
            return CheckResult.false(
                f'"Coming soon" page should redirects '
                f'to the http://localhost:{self.port}/news/')

        return CheckResult.true()
Example #28
0
    def check_menu(self, service: str, content: str, menu_content: str,
                   helper_msg: str) -> CheckResult:
        try:
            result = self.get_ticket(service, content, helper_msg)
            if not result.result:
                return result

            page = self.read_page(f'http://localhost:{self.port}/processing')
            if menu_content in page:
                return CheckResult.true()
            else:
                return CheckResult.false(
                    f'Expected to have {menu_content} on /processing page after\n'
                    f'{helper_msg}')
        except URLError:
            return CheckResult.false(
                f'Cannot connect to the /processing page.')
Example #29
0
    def check_main_page_search(self):
        q = 'ai'
        connection = sqlite3.connect(TEST_DATABASE)
        cursor = connection.cursor()
        try:
            cursor.execute(f"SELECT `id`, `title` FROM tube_video WHERE title "
                           f"LIKE '%{q}%'")
            visible_videos = cursor.fetchall()
        except sqlite3.DatabaseError as err:
            return CheckResult.false(str(err))

        visible_video_links_with_titles_from_db = \
            [(f'/tube/watch/{x[0]}/', x[1]) for x in visible_videos]

        try:
            cursor.execute(f"SELECT `id`, `title` FROM tube_video WHERE title "
                           f"NOT LIKE '%{q}%'")
            invisible_videos = cursor.fetchall()
        except sqlite3.DatabaseError as err:
            return CheckResult.false(str(err))

        invisible_video_links_with_titles_from_db = \
            [(f'/tube/watch/{x[0]}/', x[1]) for x in invisible_videos]

        try:
            page = self.read_page(f'http://localhost:{self.port}/tube/?q={q}')
        except urllib.error.URLError:
            return CheckResult.false('Cannot connect to the main page.')

        links_from_page = re.findall(self.LINK_WITH_TEXT_PATTERN, page, re.S)
        links_from_page = self.__stripped_list_with_tuple(links_from_page)

        for video_link in visible_video_links_with_titles_from_db:
            if video_link not in links_from_page:
                return CheckResult.false(
                    'Main page should contain links with found videos '
                    'when searching')

        for video_link in invisible_video_links_with_titles_from_db:
            if video_link in links_from_page:
                return CheckResult.false(
                    f'Main page should not contain links with unfound videos '
                    f'when searching')

        return CheckResult.true()
Example #30
0
 def process_ticket(self):
     response = urlopen(f'http://localhost:{self.port}/processing')
     csrf_options = re.findall(b'<input[^>]+value="(?P<csrf>\w+)"[^>]*>',
                               response.read())
     if not csrf_options:
         return CheckResult.false('Add csrf_token to your form')
     set_cookie = response.headers.get('Set-Cookie')
     opener = build_opener()
     opener.addheaders.append(('Cookie', set_cookie))
     try:
         opener.open(f'http://localhost:{self.port}/processing',
                     data=urlencode({
                         'csrfmiddlewaretoken': csrf_options[0]
                     }).encode())
     except HTTPError:
         return CheckResult.false(
             'Cannot send POST request to /processsing page')
     return CheckResult.true()