Beispiel #1
0
 def inline_the_styles(self):
     self.body_html = premailer.transform(self.raw_body_html,
                                          base_url="http://" +
                                          settings.DOMAIN + "/")
Beispiel #2
0
 def test_doctype_is_not_comments(self):
     html = """<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">"""
     transformed = transform(html, base_url="http://bar.com")
     self.assertEqual(html, transformed)
Beispiel #3
0
 def inline_the_styles(self):
     self.body_html = premailer.transform(self.raw_body_html, base_url="http://" + settings.DOMAIN + "/")
Beispiel #4
0
 def test_comments(self):
     html = """foo<!-- bar -->baz"""
     transformed = transform(html, base_url="http://bar.com")
     self.assertEqual('foobaz', transformed)
Beispiel #5
0
 def test_no_linebreak_added_to_links(self):
     html = """foo<a href="huh.bmp">bar</a>baz"""
     transformed = transform(html, base_url="http://bar.com")
     self.assertEqual("""foo<a href="http://bar.com/huh.bmp">bar</a>baz""", transformed)
Beispiel #6
0
 def test_doctype_is_not_comments(self):
     html = """<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">"""
     transformed = transform(html, base_url="http://bar.com")
     self.assertEqual(html, transformed)
Beispiel #7
0
 def test_comments(self):
     html = """foo<!-- bar -->baz"""
     transformed = transform(html, base_url="http://bar.com")
     self.assertEqual("foobaz", transformed)
Beispiel #8
0
 def test_no_linebreak_added_to_links(self):
     html = """foo<a href="huh.bmp">bar</a>baz"""
     transformed = transform(html, base_url="http://bar.com")
     self.assertEqual("""foo<a href="http://bar.com/huh.bmp">bar</a>baz""", transformed)