def test_only_practitioner_can_access(self):
     user = create_mock_user('joe')
     invoice = create_mock_invoice()
     url = reverse('invoice-appointments', args=(invoice.pk, ))
     headers = get_proxy_headers(user.id)
     response = self.client.post(url,
                                 json.dumps({}),
                                 content_type='application/json',
                                 **headers)
     assert response.status_code == 404
Ejemplo n.º 2
0
 def setUp(self):
     self.invoice = create_mock_invoice()
     self.data = {
         'medical_aid': 'Discovery',
         'medical_aid_scheme': 'Classic Comprehensive',
         'medical_aid_number': '1234',
         'patient_first_name': 'Joe',
         'patient_last_name': 'Soap',
         'patient_id_number': '5678',
         'main_member_first_name': 'Jane',
         'main_member_last_name': 'Soap',
         'main_member_id_number': '91011'
     }
Ejemplo n.º 3
0
    def setUp(self):
        '''
        curl -i -X POST -d 'payload="{\"id\":7,\"status\":\"completed\",\"totalAmount\":1000,\"tipAmount\":0,\"feeAmount\":35,\"settleAmount\":965,\"requiredAmount\":1000,\"date\":\"2018-04-23T13:51:59Z\",\"snapCode\":\"EJrKB_SJ\",\"snapCodeReference\":\"587e9743-3c7c-4e86-b54c-985ca29fe895\",\"userReference\":\"\",\"merchantReference\":\"1765\",\"statementReference\":null,\"authCode\":\"455303\",\"deliveryAddress\":null,\"extra\":{\"amount\":\"1000\",\"invoice_id\":\"1790\"}}"' https://invoiceguru.appointmentguru.co/incoming/snapscan/739B7B5E-B896-4C99-9AF5-AD424DB437A5/
        curl -i -X POST -d 'payload={\"id\":7,\"status\":\"completed\",\"totalAmount\":1000,\"tipAmount\":0,\"feeAmount\":35,\"settleAmount\":965,\"requiredAmount\":1000,\"date\":\"2018-04-23T13:51:59Z\",\"snapCode\":\"EJrKB_SJ\",\"snapCodeReference\":\"587e9743-3c7c-4e86-b54c-985ca29fe895\",\"userReference\":\"\",\"merchantReference\":\"1765\",\"statementReference\":null,\"authCode\":\"455303\",\"deliveryAddress\":null,\"extra\":{\"amount\":\"1000\",\"invoice_id\":\"1790\"}}' http://localhost:8000/incoming/snapscan/739B7B5E-B896-4C99-9AF5-AD424DB437A5/
        '''
        keen_url = 'https://api.keen.io/3.0/projects/{}/events/snapscan_webhook'.format(settings.KEEN_PROJECT_ID)
        print(keen_url)
        responses.add(
            responses.POST,
            url=keen_url,
            json={'ok': 'true'}
        )

        self.url = reverse('incoming_snapscan')
        self.invoice = create_mock_invoice()
        data = {
            "payload": "{\"id\":7,\"status\":\"completed\",\"totalAmount\":1000,\"tipAmount\":0,\"feeAmount\":35,\"settleAmount\":965,\"requiredAmount\":1000,\"date\":\"2018-04-23T13:51:59Z\",\"snapCode\":\"EJrKB_SJ\",\"snapCodeReference\":\"587e9743-3c7c-4e86-b54c-985ca29fe895\",\"userReference\":\"\",\"merchantReference\":\"1765\",\"statementReference\":null,\"authCode\":\"455303\",\"deliveryAddress\":null,\"extra\":{\"amount\":\"1000\",\"invoiceId\":\""+str(self.invoice.id)+"\"}}"
        }
        self.result = self.client.post(self.url, data)
    def setUp(self):
        responses.add(responses.GET,
                      'http://appointmentguru/api/appointments/1/',
                      json={'id': '1'},
                      status=200)
        responses.add(responses.GET,
                      'http://appointmentguru/api/appointments/2/',
                      json={'id': '2'},
                      status=200)
        responses.add(responses.GET,
                      'http://appointmentguru/api/appointments/3/',
                      json={'id': '3'},
                      status=200)

        invoice = create_mock_invoice()
        self.url = reverse('invoice-appointments', args=(invoice.pk, ))
        headers = get_proxy_headers(invoice.practitioner_id)
        data = {'appointments': '1,2,3'}
        self.response = self.client.post(self.url,
                                         json.dumps(data),
                                         content_type='application/json',
                                         **headers)
Ejemplo n.º 5
0
 def setUp(self):
     self.invoice = create_mock_invoice()
    def setUp(self):
        user_1 = create_mock_user('joe')
        user_2 = create_mock_user('jane')

        create_mock_invoice(user_1.id)
        create_mock_invoice(user_1.id)
        create_mock_invoice(user_1.id, user_2.id)

        create_mock_invoice(user_2.id)
        create_mock_invoice(user_2.id)
        create_mock_invoice(user_2.id)

        self.user_2 = user_2

        self.url = reverse('invoice-list')
        headers = get_proxy_headers(user_1.id)
        self.response = self.client.get(self.url, **headers)
Ejemplo n.º 7
0
 def setUp(self):
     self.invoice = create_mock_invoice()
     self.url = reverse('invoice_view', args=(self.invoice.pk,))
Ejemplo n.º 8
0
 def setUp(self):
     invoice = create_mock_invoice(1, 1)
     url = reverse('invoice-send', args=(invoice.id, ))
     data = {"to_email": "*****@*****.**"}
     self.response = self.client.post(url, **get_proxy_headers(1))
     self.invoice = invoice
Ejemplo n.º 9
0
 def setUp(self):
     self.invoice = create_mock_invoice()
     url = reverse('invoice_view', args=(self.invoice.id,))
     url = "{}?key={}".format(url, self.invoice.password)
     self.response = self.client.get(url)