def test_get_pofile(self):
    legalcode = LegalCodeFactory()
    test_pofile = polib.POFile()
    test_translation_filename = '/dev/null'
    with mock.patch.object(LegalCode, 'translation_filename') as mock_tf:
        mock_tf.return_value = test_translation_filename
        with mock.patch.object(polib, 'pofile') as mock_pofile:
            mock_pofile.return_value = test_pofile
            result = legalcode.get_pofile()
    mock_pofile.assert_called_with('', encoding='utf-8')
    self.assertEqual(test_pofile, result)
def test_get_pofile(self):
    legalcode = LegalCodeFactory()
    test_pofile = polib.POFile()
    test_translation_filename = '/dev/null'
    with mock.patch.object(LegalCode, 'translation_filename') as mock_tf:
        mock_tf.return_value = test_translation_filename
        with mock.patch.object(polib, 'pofile') as mock_pofile:
            mock_pofile.return_value = test_pofile
            result = legalcode.get_pofile()
    mock_pofile.assert_called_with(, encoding='utf-8')
    self.assertEqual(test_pofile, result)