示例#1
0
 def sub_test(locale, *titles):
     url = urlparams(reverse("questions.questions", locale=locale))
     response = self.client.get(url, follow=True)
     doc = pq(response.content)
     eq_msg(len(doc("section[id^=question]")), len(titles), "Wrong number of results for {0}".format(locale))
     for substr in titles:
         assert substr in doc(".questions section .content h2 a").text()
示例#2
0
 def sub_test(locale, *titles):
     url = urlparams(reverse("questions.list", args=["all"], locale=locale))
     response = self.client.get(url, follow=True)
     doc = pq(response.content)
     eq_msg(len(doc('article[id^=question]')), len(titles),
            'Wrong number of results for {0}'.format(locale))
     for substr in titles:
         assert substr in doc('.forum--question-item-heading a').text()
示例#3
0
 def sub_test(locale, *titles):
     url = urlparams(reverse('questions.questions', locale=locale))
     response = self.client.get(url, follow=True)
     doc = pq(response.content)
     eq_msg(len(doc('section[id^=question]')), len(titles),
            'Wrong number of results for {0}'.format(locale))
     for substr in titles:
         assert substr in doc('.questions section .content h2 a').text()
示例#4
0
 def sub_test(locale, *titles):
     url = urlparams(reverse(
         'questions.list', args=['all'], locale=locale))
     response = self.client.get(url, follow=True)
     doc = pq(response.content)
     eq_msg(len(doc('section[id^=question]')), len(titles),
            'Wrong number of results for {0}'.format(locale))
     for substr in titles:
         assert substr in doc('.questions section .content h2 a').text()
示例#5
0
 def sub_test(locale, *titles):
     url = urlparams(
         reverse("questions.aaq_step4", args=["desktop", "fix-problems"], locale=locale), search="question"
     )
     response = self.client.get(url, follow=True)
     doc = pq(response.content)
     eq_msg(len(doc(".result.question")), len(titles), "Wrong number of results for {0}".format(locale))
     for substr in titles:
         assert substr in doc(".result.question h3 a").text()
示例#6
0
 def sub_test(locale, *titles):
     url = urlparams(reverse('questions.aaq_step4',
                             args=['desktop', 'fix-problems'],
                             locale=locale),
                     search='question')
     response = self.client.get(url, follow=True)
     doc = pq(response.content)
     eq_msg(len(doc('.result.question')), len(titles),
            'Wrong number of results for {0}'.format(locale))
     for substr in titles:
         assert substr in doc('.result.question h3 a').text()
示例#7
0
 def sub_test(locale, *titles):
     url = urlparams(
         reverse("questions.list", args=["all"], locale=locale))
     response = self.client.get(url, follow=True)
     doc = pq(response.content)
     eq_msg(
         len(doc("section[id^=question]")),
         len(titles),
         "Wrong number of results for {0}".format(locale),
     )
     for substr in titles:
         assert substr in doc(".questions section .content h2 a").text()
示例#8
0
 def sub_test(locale, *titles):
     url = urlparams(
         reverse(
             "questions.aaq_step4",
             args=["desktop", "fix-problems"],
             locale=locale,
         ),
         search="question",
     )
     response = self.client.get(url, follow=True)
     doc = pq(response.content)
     eq_msg(
         len(doc(".result.question")),
         len(titles),
         "Wrong number of results for {0}".format(locale),
     )
     for substr in titles:
         assert substr in doc(".result.question h3 a").text()