Changeset 1217

Show
Ignore:
Timestamp:
08/29/08 03:48:34
Author:
liebster
Message:

Fixed 5 tests

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qSEOptimizer/tags/1.5.1/tests/testQSEOptimizer.py

    r1019 r1217  
    198198 
    199199    def testDescription(self): 
    200         m = re.match('.*<meta name="description" content="it is description" />', self.html, re.S|re.M) 
     200        t1 = '.*<meta name="description" content="it is description" />' 
     201        t2 = '.*<meta content="it is description" name="description" />' 
     202        m = re.match(t1, self.html, re.S|re.M) or re.match(t2, self.html, re.S|re.M) 
    201203        self.assert_(m, 'Description not set in') 
    202204 
    203205    def testKeywords(self): 
    204         m = re.match('.*<meta name="keywords" content="my1|key2" />', self.html, re.S|re.M) 
     206        t1 = '.*<meta name="keywords" content="my1|key2" />' 
     207        t2 = '.*<meta content="my1|key2" name="keywords" />' 
     208        m = re.match(t1, self.html, re.S|re.M) or re.match(t2, self.html, re.S|re.M) 
    205209        self.assert_(m, 'Keywords not set in') 
    206210 
    207211    def testRobots(self): 
    208         m = re.match('.*<meta name="robots" content="ALL" />', self.html, re.S|re.M) 
     212        t1 = '.*<meta name="robots" content="ALL" />' 
     213        t2 = '.*<meta content="ALL" name="robots" />' 
     214        m = re.match(t1, self.html, re.S|re.M) or re.match(t2, self.html, re.S|re.M) 
    209215        self.assert_(m, 'Robots not set in') 
    210216 
    211217    def testDistribution(self): 
    212         m = re.match('.*<meta name="distribution" content="Global" />', self.html, re.S|re.M) 
     218        t1 = '.*<meta content="Global" name="distribution" />' 
     219        t2 = '.*<meta name="distribution" content="Global" />' 
     220        m = re.match(t1, self.html, re.S|re.M) or re.match(t2, self.html, re.S|re.M) 
    213221        self.assert_(m, 'Distribution not set in') 
    214222 
     
    223231    def testCustomMetaTags(self): 
    224232        for tag in custom_metatags: 
    225             m = re.search('<meta name="%(meta_name)s" content="%(meta_content)s" />' % tag, self.html, re.S|re.M) 
     233            t1 = '<meta name="%(meta_name)s" content="%(meta_content)s" />' 
     234            t2 = '<meta content="%(meta_content)s" name="%(meta_name)s" />' 
     235            m = re.search(t1 % tag, self.html, re.S|re.M) or re.search(t2 % tag, self.html, re.S|re.M) 
    226236            self.assert_(m, "Custom meta tag %s not applied." % tag['meta_name']) 
    227237