def test_body_w_class_w_other_attrs(self): text = """<body class='homepage template-document_view' dir='ltr'>""" self.assertEqual( utils.add_bodyclass(text), """<body class='gray-style homepage template-document_view' dir='ltr'>""" )
def test_body_w_class_no_other_attrs(self): text = """<body class='homepage'>""" self.assertEqual(utils.add_bodyclass(text), """<body class='gray-style homepage'>""")
def test_body_w_class_many_no_other_attrs(self): text = """<body class="homepage template-document_view">""" self.assertEqual(utils.add_bodyclass(text), """<body class="gray-style homepage template-document_view">""")
def test_body_w_attrs(self): text = """<body dir="ltr">""" self.assertEqual(utils.add_bodyclass(text), """<body dir="ltr" class="gray-style">""")