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

sorry for this. a print to debug the tests. can't run them locally

parent 1bf67329
No related branches found
No related tags found
1 merge request!268Resolve "Permission and button to unfinish visit or to add appointment."
......@@ -115,6 +115,7 @@ class VisitViewTests(LoggedInTestCase):
response = self.client.get(reverse('web.views.visit_unfinish', args=[visit.id]), follow=True)
messages = list(get_messages(response.wsgi_request))
print('Messages: ', messages)
self.assertEqual(len(messages), 1)
self.assertEqual(str(messages[0]), 'You are not authorized to view this page or perform this action. Request permissions to the system administrator.')
new_visit = Visit.objects.get(id=visit.id)
......@@ -136,6 +137,7 @@ class VisitViewTests(LoggedInTestCase):
response = self.client.get(reverse('web.views.visit_unfinish', args=[visit.id]), follow=True)
messages = list(get_messages(response.wsgi_request))
print('Messages: ', messages)
self.assertEqual(len(messages), 1)
self.assertEqual(str(messages[0]), 'Visit has been unfinished.')
new_visit = Visit.objects.get(id=visit.id)
......@@ -159,6 +161,7 @@ class VisitViewTests(LoggedInTestCase):
response = self.client.get(reverse('web.views.visit_unfinish', args=[visit.id]), follow=True)
messages = list(get_messages(response.wsgi_request))
print('Messages: ', messages)
self.assertEqual(len(messages), 1)
self.assertEqual(str(messages[0]), "Visit can't be unfinished. The next visit has appointments.")
original_visit = Visit.objects.get(id=visit.id)
......@@ -185,6 +188,7 @@ class VisitViewTests(LoggedInTestCase):
#try to unfinish the original visit
response = self.client.get(reverse('web.views.visit_unfinish', args=[visit.id]), follow=True)
messages = list(get_messages(response.wsgi_request))
print('Messages: ', messages)
self.assertEqual(len(messages), 1)
self.assertEqual(str(messages[0]), "Visit can't be unfinished. Only visits with one inmediate future visit (without appointments) can be unfinished.")
self.assertEqual(3, Visit.objects.count())
......@@ -199,6 +203,7 @@ class VisitViewTests(LoggedInTestCase):
response = self.client.get(reverse('web.views.visit_unfinish', args=[visit.id]), follow=True)
messages = list(get_messages(response.wsgi_request))
print('Messages: ', messages)
self.assertEqual(len(messages), 1)
self.assertEqual(str(messages[0]), "The visit is not finished.")
......
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