def test_from_addr_and_endpoint_in_payload(self):
        message = self.create_outgoing_message()
        config = {"sendsms_url": "http://example.com"}
        backend = VumiBackend(None, "vumi", **config)
        context = {'from_addr': '5551212',
                   'endpoint': '12345',
                   'other': 'not included'}
        kwargs = backend.prepare_request(message.id, message.text,
                                         [message.connections[0].identity], context)
        data = json.loads(kwargs['data'])
        self.assertEqual(context['from_addr'], data['from_addr'])
        self.assertEqual(context['endpoint'], data['endpoint'])
        self.assertNotIn('other', data)
Easy wrapper for sending a templated email to a recipient list.
dataset/ETHPy150Open rapidsms/rapidsms/rapidsms/backends/vumi/tests.py/VumiSendTest.test_from_addr_and_endpoint_in_payload--crossover with--dataset/ETHPy150Open BradWhittington/django-templated-email/templated_email/__init__.py/send_templated_mail