Commit 4443c518 authored by Lubomír Sedlář's avatar Lubomír Sedlář

Fix tests

parent f16eab22
......@@ -71,7 +71,7 @@ class PagureFlaskPluginstests(tests.Modeltests):
sorted(names),
[
'Block non fast-forward pushes', 'Fedmsg', 'IRC', 'Mail',
'Read the Doc', 'pagure', 'pagure requests', 'pagure tickets'
'Pagure', 'Pagure requests', 'Pagure tickets', 'Read the Doc',
]
)
......
......@@ -60,12 +60,12 @@ class PagureFlaskPluginPagureHooktests(tests.Modeltests):
user = tests.FakeUser(username='pingou')
with tests.user_set(pagure.APP, user):
output = self.app.get('/test/settings/pagure')
output = self.app.get('/test/settings/Pagure')
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure settings</h3>' in output.data)
self.assertTrue('<h3>Pagure settings</h3>' in output.data)
self.assertTrue(
'<input id="active" name="active" type="checkbox" value="y">'
in output.data)
......@@ -75,19 +75,19 @@ class PagureFlaskPluginPagureHooktests(tests.Modeltests):
data = {}
output = self.app.post('/test/settings/pagure', data=data)
output = self.app.post('/test/settings/Pagure', data=data)
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure settings</h3>' in output.data)
self.assertTrue('<h3>Pagure settings</h3>' in output.data)
self.assertTrue(
'<input id="active" name="active" type="checkbox" value="y">'
in output.data)
data['csrf_token'] = csrf_token
# No git found
output = self.app.post('/test/settings/pagure', data=data)
output = self.app.post('/test/settings/Pagure', data=data)
self.assertEqual(output.status_code, 404)
tests.create_projects_git(tests.HERE)
......@@ -96,21 +96,21 @@ class PagureFlaskPluginPagureHooktests(tests.Modeltests):
# With the git repo
output = self.app.post(
'/test/settings/pagure', data=data, follow_redirects=True)
'/test/settings/Pagure', data=data, follow_redirects=True)
self.assertEqual(output.status_code, 200)
self.assertIn(
'<section class="settings">\n <h3>Settings for test</h3>',
output.data)
self.assertTrue(
'</button>\n Hook pagure inactived'
'</button>\n Hook Pagure inactived'
in output.data)
output = self.app.get('/test/settings/pagure')
output = self.app.get('/test/settings/Pagure')
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure settings</h3>' in output.data)
self.assertTrue('<h3>Pagure settings</h3>' in output.data)
self.assertTrue(
'<input id="active" name="active" type="checkbox" value="y">'
in output.data)
......@@ -125,21 +125,21 @@ class PagureFlaskPluginPagureHooktests(tests.Modeltests):
}
output = self.app.post(
'/test/settings/pagure', data=data, follow_redirects=True)
'/test/settings/Pagure', data=data, follow_redirects=True)
self.assertEqual(output.status_code, 200)
self.assertIn(
'<section class="settings">\n <h3>Settings for test</h3>',
output.data)
self.assertTrue(
'</button>\n Hook pagure activated'
'</button>\n Hook Pagure activated'
in output.data)
output = self.app.get('/test/settings/pagure')
output = self.app.get('/test/settings/Pagure')
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure settings</h3>' in output.data)
self.assertTrue('<h3>Pagure settings</h3>' in output.data)
self.assertTrue(
'<input checked id="active" name="active" type="checkbox" '
'value="y">' in output.data)
......@@ -150,21 +150,21 @@ class PagureFlaskPluginPagureHooktests(tests.Modeltests):
# De-Activate hook
data = {'csrf_token': csrf_token}
output = self.app.post(
'/test/settings/pagure', data=data, follow_redirects=True)
'/test/settings/Pagure', data=data, follow_redirects=True)
self.assertEqual(output.status_code, 200)
self.assertIn(
'<section class="settings">\n <h3>Settings for test</h3>',
output.data)
self.assertTrue(
'</button>\n Hook pagure inactived'
'</button>\n Hook Pagure inactived'
in output.data)
output = self.app.get('/test/settings/pagure')
output = self.app.get('/test/settings/Pagure')
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure settings</h3>' in output.data)
self.assertTrue('<h3>Pagure settings</h3>' in output.data)
self.assertTrue(
'<input id="active" name="active" type="checkbox" '
'value="y">' in output.data)
......
......@@ -58,12 +58,12 @@ class PagureFlaskPluginPagureRequestHooktests(tests.Modeltests):
user = tests.FakeUser(username='pingou')
with tests.user_set(pagure.APP, user):
output = self.app.get('/test/settings/pagure requests')
output = self.app.get('/test/settings/Pagure requests')
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure requests settings</h3>' in output.data)
self.assertTrue('<h3>Pagure requests settings</h3>' in output.data)
self.assertTrue(
'<input id="active" name="active" type="checkbox" value="y">'
in output.data)
......@@ -73,19 +73,19 @@ class PagureFlaskPluginPagureRequestHooktests(tests.Modeltests):
data = {}
output = self.app.post('/test/settings/pagure requests', data=data)
output = self.app.post('/test/settings/Pagure requests', data=data)
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure requests settings</h3>' in output.data)
self.assertTrue('<h3>Pagure requests settings</h3>' in output.data)
self.assertTrue(
'<input id="active" name="active" type="checkbox" value="y">'
in output.data)
data['csrf_token'] = csrf_token
# No git found
output = self.app.post('/test/settings/pagure requests', data=data)
output = self.app.post('/test/settings/Pagure requests', data=data)
self.assertEqual(output.status_code, 404)
# Create both the requests repo
......@@ -94,22 +94,22 @@ class PagureFlaskPluginPagureRequestHooktests(tests.Modeltests):
# With the git repo
tests.create_projects_git(tests.HERE)
output = self.app.post(
'/test/settings/pagure requests', data=data,
'/test/settings/Pagure requests', data=data,
follow_redirects=True)
self.assertEqual(output.status_code, 200)
self.assertIn(
'<section class="settings">\n <h3>Settings for test</h3>',
output.data)
self.assertTrue(
'</button>\n Hook pagure requests inactived'
'</button>\n Hook Pagure requests inactived'
in output.data)
output = self.app.get('/test/settings/pagure requests')
output = self.app.get('/test/settings/Pagure requests')
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure requests settings</h3>' in output.data)
self.assertTrue('<h3>Pagure requests settings</h3>' in output.data)
self.assertTrue(
'<input id="active" name="active" type="checkbox" value="y">'
in output.data)
......@@ -125,22 +125,22 @@ class PagureFlaskPluginPagureRequestHooktests(tests.Modeltests):
}
output = self.app.post(
'/test/settings/pagure requests', data=data,
'/test/settings/Pagure requests', data=data,
follow_redirects=True)
self.assertEqual(output.status_code, 200)
self.assertIn(
'<section class="settings">\n <h3>Settings for test</h3>',
output.data)
self.assertTrue(
'</button>\n Hook pagure requests activated'
'</button>\n Hook Pagure requests activated'
in output.data)
output = self.app.get('/test/settings/pagure requests')
output = self.app.get('/test/settings/Pagure requests')
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure requests settings</h3>' in output.data)
self.assertTrue('<h3>Pagure requests settings</h3>' in output.data)
self.assertTrue(
'<input checked id="active" name="active" type="checkbox" '
'value="y">' in output.data)
......@@ -152,22 +152,22 @@ class PagureFlaskPluginPagureRequestHooktests(tests.Modeltests):
# De-Activate hook
data = {'csrf_token': csrf_token}
output = self.app.post(
'/test/settings/pagure requests', data=data,
'/test/settings/Pagure requests', data=data,
follow_redirects=True)
self.assertEqual(output.status_code, 200)
self.assertIn(
'<section class="settings">\n <h3>Settings for test</h3>',
output.data)
self.assertTrue(
'</button>\n Hook pagure requests inactived'
'</button>\n Hook Pagure requests inactived'
in output.data)
output = self.app.get('/test/settings/pagure requests')
output = self.app.get('/test/settings/Pagure requests')
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure requests settings</h3>' in output.data)
self.assertTrue('<h3>Pagure requests settings</h3>' in output.data)
self.assertTrue(
'<input id="active" name="active" type="checkbox" '
'value="y">' in output.data)
......@@ -183,7 +183,7 @@ class PagureFlaskPluginPagureRequestHooktests(tests.Modeltests):
}
shutil.rmtree(os.path.join(tests.HERE, 'requests', 'test.git'))
output = self.app.post('/test/settings/pagure requests', data=data)
output = self.app.post('/test/settings/Pagure requests', data=data)
self.assertEqual(output.status_code, 404)
......
......@@ -58,12 +58,12 @@ class PagureFlaskPluginPagureTicketHooktests(tests.Modeltests):
user = tests.FakeUser(username='pingou')
with tests.user_set(pagure.APP, user):
output = self.app.get('/test/settings/pagure tickets')
output = self.app.get('/test/settings/Pagure tickets')
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure tickets settings</h3>' in output.data)
self.assertTrue('<h3>Pagure tickets settings</h3>' in output.data)
self.assertTrue(
'<input id="active" name="active" type="checkbox" value="y">'
in output.data)
......@@ -73,19 +73,19 @@ class PagureFlaskPluginPagureTicketHooktests(tests.Modeltests):
data = {}
output = self.app.post('/test/settings/pagure tickets', data=data)
output = self.app.post('/test/settings/Pagure tickets', data=data)
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure tickets settings</h3>' in output.data)
self.assertTrue('<h3>Pagure tickets settings</h3>' in output.data)
self.assertTrue(
'<input id="active" name="active" type="checkbox" value="y">'
in output.data)
data['csrf_token'] = csrf_token
# No git found
output = self.app.post('/test/settings/pagure tickets', data=data)
output = self.app.post('/test/settings/Pagure tickets', data=data)
self.assertEqual(output.status_code, 404)
# Create both the tickets repo
......@@ -94,22 +94,22 @@ class PagureFlaskPluginPagureTicketHooktests(tests.Modeltests):
# With the git repo
tests.create_projects_git(tests.HERE)
output = self.app.post(
'/test/settings/pagure tickets', data=data,
'/test/settings/Pagure tickets', data=data,
follow_redirects=True)
self.assertEqual(output.status_code, 200)
self.assertIn(
'<section class="settings">\n <h3>Settings for test</h3>',
output.data)
self.assertTrue(
'</button>\n Hook pagure tickets inactived'
'</button>\n Hook Pagure tickets inactived'
in output.data)
output = self.app.get('/test/settings/pagure tickets')
output = self.app.get('/test/settings/Pagure tickets')
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure tickets settings</h3>' in output.data)
self.assertTrue('<h3>Pagure tickets settings</h3>' in output.data)
self.assertTrue(
'<input id="active" name="active" type="checkbox" value="y">'
in output.data)
......@@ -125,22 +125,22 @@ class PagureFlaskPluginPagureTicketHooktests(tests.Modeltests):
}
output = self.app.post(
'/test/settings/pagure tickets', data=data,
'/test/settings/Pagure tickets', data=data,
follow_redirects=True)
self.assertEqual(output.status_code, 200)
self.assertIn(
'<section class="settings">\n <h3>Settings for test</h3>',
output.data)
self.assertTrue(
'</button>\n Hook pagure tickets activated'
'</button>\n Hook Pagure tickets activated'
in output.data)
output = self.app.get('/test/settings/pagure tickets')
output = self.app.get('/test/settings/Pagure tickets')
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure tickets settings</h3>' in output.data)
self.assertTrue('<h3>Pagure tickets settings</h3>' in output.data)
self.assertTrue(
'<input checked id="active" name="active" type="checkbox" '
'value="y">' in output.data)
......@@ -152,22 +152,22 @@ class PagureFlaskPluginPagureTicketHooktests(tests.Modeltests):
# De-Activate hook
data = {'csrf_token': csrf_token}
output = self.app.post(
'/test/settings/pagure tickets', data=data,
'/test/settings/Pagure tickets', data=data,
follow_redirects=True)
self.assertEqual(output.status_code, 200)
self.assertIn(
'<section class="settings">\n <h3>Settings for test</h3>',
output.data)
self.assertTrue(
'</button>\n Hook pagure tickets inactived'
'</button>\n Hook Pagure tickets inactived'
in output.data)
output = self.app.get('/test/settings/pagure tickets')
output = self.app.get('/test/settings/Pagure tickets')
self.assertEqual(output.status_code, 200)
self.assertIn(
'<div class="projectinfo m-t-1 m-b-1">\n'
'test project #1 </div>', output.data)
self.assertTrue('<h3>pagure tickets settings</h3>' in output.data)
self.assertTrue('<h3>Pagure tickets settings</h3>' in output.data)
self.assertTrue(
'<input id="active" name="active" type="checkbox" '
'value="y">' in output.data)
......@@ -183,7 +183,7 @@ class PagureFlaskPluginPagureTicketHooktests(tests.Modeltests):
}
shutil.rmtree(os.path.join(tests.HERE, 'tickets', 'test.git'))
output = self.app.post('/test/settings/pagure tickets', data=data)
output = self.app.post('/test/settings/Pagure tickets', data=data)
self.assertEqual(output.status_code, 404)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment