Skip to content
Snippets Groups Projects
Commit c9d4da3c authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

fix: some test fixes

parent 329bf188
No related branches found
No related tags found
1 merge request!261Python3 translation
......@@ -328,4 +328,5 @@ class TnsCsvVisitImportReader:
def remove_bom(line):
line = line.decode('utf8')
return line[3:] if line.startswith(codecs.BOM_UTF8) else line
......@@ -30,7 +30,7 @@ class TestDocxProcessor(TestCase):
"##ADDRESS2##": "61-234, Poznan",
"##COUNTRY##": "POLAND",
"##CONTENT##": "1",
"##DATE##": datetime.datetime.now().date().strftime("%A %d %B %Y").decode(date_format_encoding()),
"##DATE##": datetime.datetime.now().date().strftime("%A %d %B %Y"),
}
process_file(template_path, output_path, changes)
self.assertTrue(os.path.isfile(output_path))
......
......@@ -5,14 +5,14 @@ from web.tests import LoggedInTestCase
import logging
logger = logging.getLogger(__name__)
class ConfigurationViewTests(LoggedInTestCase):
def test_visit_details_request(self):
self.login_as_admin()
self.login_as_admin()
response = self.client.get(reverse('web.views.configuration'))
self.assertEqual(response.status_code, 200)
def test_visit_details_request_without_permissions(self):
self.login_as_staff()
self.login_as_staff()
response = self.client.get(reverse('web.views.configuration'))
self.assertEqual(response.status_code, 302)
......@@ -15,10 +15,10 @@ class TestStatisticsView(LoggedInTestCase):
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
current_month = datetime.now().month - 1 or 12
content = response.content
content = response.content.decode('utf8')
self.assertIn('<option value="{}" selected>'.format(current_month), content)
response = self.client.get(url, {"month": 10, "year": 2017, "subject_type": -1, "visit": -1})
content = response.content
content = response.content.decode('utf8')
self.assertIn('<option value="10" selected>October', content)
def test_statistics_request_without_permission(self):
......
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