Assert that msgids extracted from a given module match a snapshot.
(self, module)
| 42 | class TestTranslationsBase(unittest.TestCase): |
| 43 | |
| 44 | def assertMsgidsEqual(self, module): |
| 45 | '''Assert that msgids extracted from a given module match a |
| 46 | snapshot. |
| 47 | |
| 48 | ''' |
| 49 | skip_if_missing('i18n') |
| 50 | res = _generate_po_file(module.__file__, stdout_only=False) |
| 51 | self.assertEqual(res.returncode, 0) |
| 52 | self.assertEqual(res.stderr, '') |
| 53 | msgids = _extract_msgids(res.stdout) |
| 54 | snapshot_path = _get_snapshot_path(module.__name__) |
| 55 | snapshot = snapshot_path.read_text().splitlines() |
| 56 | self.assertListEqual(msgids, snapshot) |
| 57 | |
| 58 | |
| 59 | def update_translation_snapshots(module): |