def mocked_i18n_open(*content):
 read_data = ''.join((textwrap.dedent(c) for c in content))
 return patch.object(pavelib.i18n, 'open', create=True, new=mock_open(read_data=read_data))

def mocked_i18n_open ( * content ) : read_data = '' . join ( ( textwrap . dedent ( c ) for c in content ) ) return patch . object ( pavelib . i18n , 'open' , create = True , new = mock_open ( read_data = read_data ) )
helper decorator to mock open() in pavelib .