def setUp(self): request = Mock() request.method = 'GET' request.GET = {'msgid': 'the-msgid'} get_all_translations = Mock(return_value={"dummy": "json"}) with patch('livetranslation.views.get_all_translations', get_all_translations): self.response = get_translations(request)
def setUp(self): request = Mock() request.method = 'POST' request.POST = {'livetranslation-popup-0-msgid': 'the-msgid', 'livetranslation-popup-0-en': 'the-msgstr'} with patch('livetranslation.views.save_translations') as save: self.response = get_translations(request) self.save_translations = save