def get_random_page_and_random_post(self):
     random_page_response = self._get_page()
     if random_page_response.status_code == 200:
         topic_link = parse_qa_url(random_page_response)
         self.client.request('GET', topic_link, verify=False)
     else:
         pass
    def view_without_answer(self):
        url_view_without = BASE_URL + '{0}'.format('/questions/without_answer')
        view_without_response = self.client.request('GET',
                                                    url_view_without,
                                                    verify=False)

        topic_link = parse_qa_url(view_without_response)
        self.client.request('GET', topic_link, verify=False)
    def view_new_questions(self):
        url_view_new = BASE_URL + '{0}'.format('/questions/latest')
        view_new_response = self.client.request('GET',
                                                url_view_new,
                                                verify=False)

        topic_link = parse_qa_url(view_new_response)
        self.client.request('GET', topic_link, verify=False)
    def view_interesting_questions(self):
        url_view_interesting = BASE_URL + '{0}'.format(
            '/questions/interesting')
        view_interesting_response = self.client.request('GET',
                                                        url_view_interesting,
                                                        verify=False)

        topic_link = parse_qa_url(view_interesting_response)
        self.client.request('GET', topic_link, verify=False)
    def success_search(self):
        qa_items = [
            'js', 'python', 'java', 'api', 'ajax', 'soup', 'devops', 'load',
            'php', 'domain', 'asp', 'core', 'learn', 'machine', 'docker',
            'vagrant', 'django', 'flask'
        ]
        url_success_search = BASE_URL + '{0}'.format('/search')
        success_search_payload = {
            'q': qa_items[random.randint(1,
                                         len(qa_items) - 1)]
        }
        success_search_response = self.client.request(
            'GET',
            url_success_search,
            params=success_search_payload,
            verify=False)

        topic_link = parse_qa_url(success_search_response)
        self.client.request('GET', topic_link, verify=False)