def setUp(self): patcher = patch( 'openedx.core.djangoapps.schedules.templatetags.ace.get_current_request' ) self.mock_get_current_request = patcher.start() self.addCleanup(patcher.stop) self.fake_request = HttpRequest() self.fake_request.user = UserFactory.create() self.fake_request.site = SiteFactory.create() self.fake_request.site.domain = 'example.com' self.mock_get_current_request.return_value = self.fake_request self.message = Message( app_label='test_app_label', name='test_name', recipient=Recipient(username='******'), context={}, send_uuid=uuid.uuid4(), ) self.context = {'message': self.message}
def setUp(self): super(EmailTemplateTagMixin, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments patcher = patch( 'openedx.core.djangoapps.ace_common.templatetags.ace.get_current_request' ) self.mock_get_current_request = patcher.start() self.addCleanup(patcher.stop) self.fake_request = HttpRequest() self.fake_request.user = UserFactory.create() self.fake_request.site = SiteFactory.create() self.fake_request.site.domain = 'example.com' self.mock_get_current_request.return_value = self.fake_request self.message = Message( app_label='test_app_label', name='test_name', recipient=Recipient(username='******'), context={}, send_uuid=uuid.uuid4(), ) self.context = {'message': self.message}