Exemplo n.º 1
0
 def test_that_we_can_read_different_export_versions(self):
     post = fromstring(
         wp_export_fragment(self.post_text, annoying_version='1.0'))
     parsed_post = parse_post(post)
     post2 = fromstring(
         wp_export_fragment(self.post_text, annoying_version='1.1'))
     parsed_post2 = parse_post(post)
     self.assertEquals(parsed_post, parsed_post2)
Exemplo n.º 2
0
 def test_parse_post(self):
     post = fromstring(wp_export_fragment(self.post_text))
     parsed_post = parse_post(post)
     self.assertEquals(
         parsed_post['title'],
         'Somewhere Real Estate Sellers, Your Time Has Come!')
     assert ('Real Estate Expert' in parsed_post['body'])
Exemplo n.º 3
0
    def test_parse_postmeta(self):
        post_text = """<item>
                <wp:post_type>post</wp:post_type>
		<wp:postmeta>
			<wp:meta_key>_wp_attached_file</wp:meta_key>
			<wp:meta_value><![CDATA[2009/09/Ft-Desoto-Sunrise.jpg]]></wp:meta_value>
		</wp:postmeta>
                </item>
        """
        post = fromstring(wp_export_fragment(post_text))
        parsed_post = parse_post(post)
        self.assertEquals(parsed_post['postmeta']['_wp_attached_file'], '2009/09/Ft-Desoto-Sunrise.jpg')
Exemplo n.º 4
0
    def test_parse_postmeta(self):
        post_text = """<item>
                <wp:post_type>post</wp:post_type>
		<wp:postmeta>
			<wp:meta_key>_wp_attached_file</wp:meta_key>
			<wp:meta_value><![CDATA[2009/09/Ft-Desoto-Sunrise.jpg]]></wp:meta_value>
		</wp:postmeta>
                </item>
        """
        post = fromstring(wp_export_fragment(post_text))
        parsed_post = parse_post(post)
        self.assertEquals(parsed_post['postmeta']['_wp_attached_file'],
                          '2009/09/Ft-Desoto-Sunrise.jpg')
Exemplo n.º 5
0
 def test_parse_post_datetime_converstion(self):
     post = fromstring(wp_export_fragment(self.post_text))
     parsed_post = parse_post(post)
     self.assertEquals(parsed_post['pubDate'],
                       datetime.datetime(2012, 5, 27, 17, 15, 14))
Exemplo n.º 6
0
 def test_parse_post_datetime_converstion(self):
     post = fromstring(wp_export_fragment(self.post_text))
     parsed_post = parse_post(post)
     self.assertEquals(parsed_post['pubDate'],datetime.datetime(2012,5,27,17,15,14))
Exemplo n.º 7
0
 def test_that_we_can_read_different_export_versions(self):
     post = fromstring(wp_export_fragment(self.post_text,annoying_version='1.0'))
     parsed_post = parse_post(post)
     post2 = fromstring(wp_export_fragment(self.post_text,annoying_version='1.1'))
     parsed_post2 = parse_post(post)
     self.assertEquals(parsed_post,parsed_post2)
Exemplo n.º 8
0
 def test_parse_post(self):
     post = fromstring(wp_export_fragment(self.post_text))
     parsed_post = parse_post(post)
     self.assertEquals(parsed_post['title'],'Somewhere Real Estate Sellers, Your Time Has Come!')
     assert('Real Estate Expert' in parsed_post['body'])