Commits

Anonymous committed 0cfadca

Corrected bug: H was undefined. Also, removed check for alt being same as title. That's absolutely fine.

Comments (0)

Files changed (1)

                     for heading in self.doc.findAll(re.compile('h[1-6]'))]
 
         if not len(headings):
-            self.error('Missing H1, H2, ... H6 tags' + H)
+            self.error('Missing H1, H2, ... H6 tags')
             return
 
         err = False
 
 
     def test_title_alt_are_same(self):
-        '''Title attribute shouild not be the same as alt or the copy text'''
+        '''Text should not be same as title or alt. (alt = title is OK)'''
         for tag in self.doc.findAll(attrs={'title':re.compile('.*')}):
             title, alt, text = tag['title'], tag.get('alt', ''), tag.text
-            if _(title) == _(alt):
-              if tag.name != 'img':
-                self.error('%s title is same as alt: %s' % (tag.name, title))
             if _(title) == _(text):
                 self.error('%s title is same as text: %s' % (tag.name, title))
+            if _(alt) == _(text):
+                self.error('%s alt is same as text: %s' % (tag.name, title))
 
 
     def test_title_tag(self):