(self)
| 68 | """ |
| 69 | |
| 70 | def test_pickle_and_unpickle_identity(self): |
| 71 | # Pickling a tree, then unpickling it, yields a tree identical |
| 72 | # to the original. |
| 73 | tree = self.soup("<a><b>foo</a>") |
| 74 | dumped = pickle.dumps(tree, 2) |
| 75 | loaded = pickle.loads(dumped) |
| 76 | self.assertEqual(loaded.__class__, BeautifulSoup) |
| 77 | self.assertEqual(loaded.decode(), tree.decode()) |
| 78 | |
| 79 | def assertDoctypeHandled(self, doctype_fragment): |
| 80 | """Assert that a given doctype string is handled correctly.""" |