Ejemplo n.º 1
0
 def testWillCallTranslationDeactivateAfterCallingBlock(self, translation):
     with locale_context('pl_PL'):
         translation.deactivate.assert_not_called()
     translation.deactivate.assert_called_once()
Ejemplo n.º 2
0
 def testWillCallWhateverIsInTheBlock(self, translation):
     fun = mock.Mock()
     with locale_context('anything'):
         fun()
     fun.assert_called_once()
Ejemplo n.º 3
0
 def testWillCallTranslationActivateBeforeCallingBlock(self, translation): 
     with locale_context('pl_PL'):
         translation.activate.assert_called_once_with('pl_PL')
     translation.activate.assert_called_once_with('pl_PL')