예제 #1
0
 def test_login_link(self):
     r = self.client.get(reverse('home'), follow=True)
     doc = PyQuery(r.content)
     next = urllib.urlencode({'to': '/en-US/firefox/'})
     eq_('/en-US/firefox/users/login?%s' % next,
         doc('.account.anonymous a')[1].attrib['href'])
예제 #2
0
 def title_eq(url, alt, text):
     response = self.client.get(url, follow=True)
     doc = PyQuery(response.content)
     eq_(alt, doc('.site-title img').attr('alt'))
     eq_(text, doc('.site-title').text())
예제 #3
0
 def check(expected):
     response = self.client.get('/', follow=True)
     anon = PyQuery(response.content)('body').attr('data-anonymous')
     eq_(anon, expected)
예제 #4
0
 def get_homepage():
     response = self.client.get('/', follow=True)
     return PyQuery(response.content)
예제 #5
0
파일: test_views.py 프로젝트: rlr/zamboni
 def check(expected):
     response = self.client.get('/', follow=True)
     account = PyQuery(response.content)('ul.account')
     tools = PyQuery(response.content)('ul.tools')
     eq_(account.size(), expected)
     eq_(tools.size(), expected)