From 645b6673a9a2d2e5de66c470b5ef4d93ef476330 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jul 11 2016 11:51:24 +0000 Subject: Expend the unit-tests to include an example with cirillic characters --- diff --git a/tests/test_pagure_flask_ui_app.py b/tests/test_pagure_flask_ui_app.py index 1b085f6..1236f14 100644 --- a/tests/test_pagure_flask_ui_app.py +++ b/tests/test_pagure_flask_ui_app.py @@ -309,17 +309,35 @@ class PagureFlaskApptests(tests.Modeltests):

Prõjéctö #1

''', output.data if six.PY2 else output.data.decode('utf-8')) + data = { + 'description': 'Мой первый суперский репозиторий', + 'name': 'project-2', + 'csrf_token': csrf_token, + 'create_readme': True, + } + output = self.app.post('/new/', data=data, follow_redirects=True) + self.assertEqual(output.status_code, 200) + self.assertIn( + '
\nМой первый суперский репозиторий
', + output.data if six.PY2 else output.data.decode('utf-8')) + self.assertIn( + '''
+

project-2

+

Мой первый суперский репозиторий

+
''', output.data if six.PY2 else output.data.decode('utf-8')) + # After projects = pagure.lib.search_projects(self.session) - self.assertEqual(len(projects), 1) - self.assertTrue(os.path.exists( - os.path.join(tests.HERE, 'project-1.git'))) - self.assertTrue(os.path.exists( - os.path.join(tests.HERE, 'tickets', 'project-1.git'))) - self.assertTrue(os.path.exists( - os.path.join(tests.HERE, 'docs', 'project-1.git'))) - self.assertTrue(os.path.exists( - os.path.join(tests.HERE, 'requests', 'project-1.git'))) + self.assertEqual(len(projects), 2) + for project in ['project-1', 'project-2']: + self.assertTrue(os.path.exists( + os.path.join(tests.HERE, '%s.git' % project))) + self.assertTrue(os.path.exists( + os.path.join(tests.HERE, 'tickets', '%s.git' % project))) + self.assertTrue(os.path.exists( + os.path.join(tests.HERE, 'docs', '%s.git' % project))) + self.assertTrue(os.path.exists( + os.path.join(tests.HERE, 'requests', '%s.git' % project))) @patch('pagure.ui.app.admin_session_timedout') def test_user_settings(self, ast):