Skip to content
Snippets Groups Projects
Commit 240e128d authored by Carlos Vega's avatar Carlos Vega
Browse files

tests to reproduce encoding errors when adding an appointment

parent 65e5810f
No related branches found
No related tags found
1 merge request!259Encoding issue
# coding=utf-8
from django.test import TestCase
from web.forms import AppointmentAddForm
......@@ -21,6 +22,7 @@ class AppointmentAddFormTests(TestCase):
'length': '50',
'visit': self.visit.id,
'location': location.id,
'comment': u'A unicode comment with weird letters such as á è ü ñ ô',
'datetime_when': "2020-01-01",
}
......
......@@ -39,6 +39,7 @@ class AppointmentsViewTests(LoggedInTestCase):
form_data['datetime_when'] = datetime.datetime.today()
form_data['location'] = location.id
form_data['length'] = 10
form_data['comment'] = u'A comment with weird letters such as á è ü ñ ô'
response = self.client.post(reverse('web.views.appointment_add_general'), data=form_data)
self.assertEqual(response.status_code, 302)
......@@ -64,7 +65,7 @@ class AppointmentsViewTests(LoggedInTestCase):
subject = create_study_subject()
visit = create_visit(subject)
appointment = create_appointment(visit, when=datetime.datetime.now())
new_comment = 'new comment'
new_comment = u'new unicode comment with accents à è ì ò ù'
new_status = appointment.APPOINTMENT_STATUS_NO_SHOW
new_last_name = "new last name"
form_data = self.prepare_form(appointment, subject)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment