The syntax won't work with beautiful soup. You'll need to use has_key,  but
sure.  Go ahead and revise it and I'm fine with it.
On 30 Nov 2013 13:47, "Florian Rathgeber" <notifications@github.com> wrote:

> In oabutton/apps/web/tests.py:
>
> >      @patch('oabutton.apps.bookmarklet.models.OAEvent', MockOAEvent)
> >      def test_count_denied_pursuits(self):
> >          response = self.client.get('/')
> >          eq_(response.context['count'], 2)
> >
> > -        content = re.sub(r'\s+', ' ', response.content)
> > -        ok_(content.find(r"""<span id="counter">2 </span><span>Paywalls Hit </span>""") != -1)
> > +        soup = BeautifulSoup.BeautifulSoup(response.content)
> > +        node = soup.find('span', attrs={'id': 'counter'})
> > +        eq_(node.text, '2')
> > +        eq_(node.nextSibling.text, u'Paywalls Hit')
> > +
> > +    @patch('oabutton.apps.bookmarklet.models.OAEvent', MockOAEvent)
> > +    def test_versioned_static_content(self):
> > +        response = self.client.get('/')
> > +        soup = BeautifulSoup.BeautifulSoup(response.content)
> > +        scripts = [s for s in soup.findAll('script') if s.has_key('src')]  # NOQA
>
> Sorry, I misread, I hadn't seen you were reusing scripts on the following
> line. This is fine, but change it to:
>
> scripts = [s for s in soup.findAll('script') if 'src' in s]
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/OAButton/OAButton/pull/198/files#r8011684>
> .
>