def test_update_translation__has_partner(self):
     from randtalkbot.stranger_sender import get_translation
     self.stranger.get_common_languages.reset_mock()
     self.stranger.get_common_languages.return_value = 'foo_common_languages'
     partner = Mock()
     self.sender.update_translation(partner)
     self.stranger.get_common_languages.assert_called_once_with(partner)
     get_translation.assert_called_once_with('foo_common_languages')
     self.assertEqual(self.sender._, 'foo_translation')
예제 #2
0
 def test_update_translation__has_partner(self):
     from randtalkbot.stranger_sender import get_translation
     self.stranger.get_common_languages.reset_mock()
     self.stranger.get_common_languages.return_value = 'foo_common_languages'
     partner = Mock()
     self.sender.update_translation(partner)
     self.stranger.get_common_languages.assert_called_once_with(partner)
     get_translation.assert_called_once_with('foo_common_languages')
     self.assertEqual(self.sender._, 'foo_translation')
 def test_update_translation__has_not_partner(self):
     from randtalkbot.stranger_sender import get_translation
     self.stranger.partner = None
     self.sender.update_translation()
     get_translation.assert_called_once_with('foo_languages')
     self.assertEqual(self.sender._, 'foo_translation')
예제 #4
0
 def test_update_translation__has_not_partner(self):
     from randtalkbot.stranger_sender import get_translation
     self.stranger.partner = None
     self.sender.update_translation()
     get_translation.assert_called_once_with('foo_languages')
     self.assertEqual(self.sender._, 'foo_translation')