From 65e5810f92593fa777cb6e559a989c8a84e411f5 Mon Sep 17 00:00:00 2001 From: Carlos Vega <carlos.vega@uni.lu> Date: Thu, 9 Jul 2020 13:01:00 +0200 Subject: [PATCH] tests to reproduce encoding errors when adding an appointment --- smash/web/tests/forms/test_AppointmentEditForm.py | 2 ++ smash/web/tests/view/test_appointments.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/smash/web/tests/forms/test_AppointmentEditForm.py b/smash/web/tests/forms/test_AppointmentEditForm.py index ff8140c0..a279e8bf 100644 --- a/smash/web/tests/forms/test_AppointmentEditForm.py +++ b/smash/web/tests/forms/test_AppointmentEditForm.py @@ -1,3 +1,4 @@ +# coding=utf-8 from django.test import TestCase from web.forms import AppointmentEditForm, AppointmentAddForm @@ -19,6 +20,7 @@ class AppointmentEditFormTests(TestCase): self.sample_data = {'first_name': 'name', 'length': '50', 'location': location.id, + 'comment': u'A unicode comment with weird letters such as á è ü ñ ô', 'datetime_when': "2020-01-01", } self.sample_data_with_status = self.sample_data diff --git a/smash/web/tests/view/test_appointments.py b/smash/web/tests/view/test_appointments.py index 9c7630b2..6c990ea7 100644 --- a/smash/web/tests/view/test_appointments.py +++ b/smash/web/tests/view/test_appointments.py @@ -1,3 +1,4 @@ +# coding=utf-8 import datetime import logging @@ -49,6 +50,7 @@ class AppointmentsViewTests(LoggedInTestCase): form_appointment = AppointmentAddForm(user=self.user) form_data['datetime_when'] = datetime.datetime.today() form_data['location'] = location.id + form_data['comment'] = u'A comment with weird letters such as á è ü ñ ô' form_data['length'] = 10 response = self.client.post(reverse('web.views.appointment_add', kwargs={'visit_id': visit.id}), data=form_data) -- GitLab