Skip to content

Commit a4f415b

Browse files
committed
Remove tests for admin
1 parent 3939978 commit a4f415b

File tree

1 file changed

+17
-40
lines changed

1 file changed

+17
-40
lines changed

devtools/tests/test_quickstart.py

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,6 @@ def test_login(self):
233233
resp = self.app.get('/login')
234234
assert '<h1>Login</h1>' in resp
235235

236-
def test_unauthenticated_admin(self):
237-
assert (
238-
'<h1>Login</h1>' in self.app.get('/admin/', status=302).follow()
239-
)
240-
241236
def test_subtests(self):
242237
passed, failed, lines = get_passed_and_failed(self.env_cmd,
243238
self.python_cmd,
@@ -270,35 +265,40 @@ def test_subtests(self):
270265

271266

272267
class CommonTestQuickStartWithAuth(CommonTestQuickStart):
273-
def test_unauthenticated_admin_with_prefix(self):
274-
resp1 = self.app.get('/prefix/admin/', extra_environ={'SCRIPT_NAME': '/prefix'}, status=302)
268+
def test_secured_controller(self):
269+
assert (
270+
'<h1>Login</h1>' in self.app.get('/secc/', status=302).follow()
271+
)
272+
273+
def test_secured_controller_with_prefix(self):
274+
resp1 = self.app.get('/prefix/secc/', extra_environ={'SCRIPT_NAME': '/prefix'}, status=302)
275275
assert (
276-
resp1.headers['Location'] == 'http://localhost/prefix/login?came_from=%2Fprefix%2Fadmin%2F'
276+
resp1.headers['Location'] == 'http://localhost/prefix/login?came_from=%2Fprefix%2Fsecc%2F'
277277
), resp1.headers['Location']
278278
resp2 = resp1.follow(extra_environ={'SCRIPT_NAME': '/prefix'})
279279
assert '/prefix/login_handler' in resp2, resp2
280280

281281
def test_login_with_prefix(self):
282282
self.init_database()
283-
resp1 = self.app.post('/prefix/login_handler?came_from=%2Fprefix%2Fadmin%2F',
283+
resp1 = self.app.post('/prefix/login_handler?came_from=%2Fprefix%2Fsecc%2F',
284284
params={'login': 'editor', 'password': 'editpass'},
285285
extra_environ={'SCRIPT_NAME': '/prefix'})
286286
assert (
287-
resp1.headers['Location'] == 'http://localhost/prefix/post_login?came_from=%2Fprefix%2Fadmin%2F'
287+
resp1.headers['Location'] == 'http://localhost/prefix/post_login?came_from=%2Fprefix%2Fsecc%2F'
288288
), resp1.headers['Location']
289289
resp2 = resp1.follow(extra_environ={'SCRIPT_NAME': '/prefix'})
290290
assert (
291-
resp2.headers['Location'] == 'http://localhost/prefix/admin/'
291+
resp2.headers['Location'] == 'http://localhost/prefix/secc/'
292292
), resp2.headers['Location']
293293

294294
def test_login_failure_with_prefix(self):
295295
self.init_database()
296-
resp = self.app.post('/prefix/login_handler?came_from=%2Fprefix%2Fadmin%2F',
296+
resp = self.app.post('/prefix/login_handler?came_from=%2Fprefix%2Fsecc%2F',
297297
params={'login': 'WRONG', 'password': 'WRONG'},
298298
extra_environ={'SCRIPT_NAME': '/prefix'})
299299
location = resp.headers['Location']
300300
assert 'http://localhost/prefix/login' in location, location
301-
assert 'came_from=%2Fprefix%2Fadmin%2F' in location, location
301+
assert 'came_from=%2Fprefix%2Fsecc%2F' in location, location
302302

303303

304304
class TestDefaultQuickStart(CommonTestQuickStartWithAuth, unittest.TestCase):
@@ -313,7 +313,7 @@ def setUp(self):
313313

314314

315315
class TestMakoQuickStart(CommonTestQuickStart, unittest.TestCase):
316-
args = '--mako --nosa --noauth --skip-tw'
316+
args = '--mako --nosa --noauth'
317317

318318
pass_tests = ['/tests/functional/test_root.']
319319
skip_tests = [
@@ -324,12 +324,9 @@ class TestMakoQuickStart(CommonTestQuickStart, unittest.TestCase):
324324
def test_login(self):
325325
self.app.get('/login', status=404)
326326

327-
def test_unauthenticated_admin(self):
328-
self.app.get('/admin', status=404)
329-
330327

331328
class TestGenshiQuickStart(CommonTestQuickStart, unittest.TestCase):
332-
args = '--genshi --nosa --noauth --skip-tw'
329+
args = '--genshi --nosa --noauth'
333330

334331
pass_tests = ['/tests/functional/test_root.']
335332
skip_tests = [
@@ -340,12 +337,9 @@ class TestGenshiQuickStart(CommonTestQuickStart, unittest.TestCase):
340337
def test_login(self):
341338
self.app.get('/login', status=404)
342339

343-
def test_unauthenticated_admin(self):
344-
self.app.get('/admin', status=404)
345-
346340

347341
class TestJinjaQuickStart(CommonTestQuickStart, unittest.TestCase):
348-
args = '--jinja --nosa --noauth --skip-tw'
342+
args = '--jinja --nosa --noauth'
349343

350344
pass_tests = ['/tests/functional/test_root.']
351345
skip_tests = [
@@ -356,9 +350,6 @@ class TestJinjaQuickStart(CommonTestQuickStart, unittest.TestCase):
356350
def test_login(self):
357351
self.app.get('/login', status=404)
358352

359-
def test_unauthenticated_admin(self):
360-
self.app.get('/admin', status=404)
361-
362353

363354
class TestNoDBQuickStart(CommonTestQuickStart, unittest.TestCase):
364355

@@ -368,14 +359,11 @@ class TestNoDBQuickStart(CommonTestQuickStart, unittest.TestCase):
368359
'/tests/functional/test_authentication.',
369360
'/tests/models/test_auth.']
370361

371-
args = '--nosa --noauth --skip-tw'
362+
args = '--nosa --noauth'
372363

373364
def test_login(self):
374365
self.app.get('/login', status=404)
375366

376-
def test_unauthenticated_admin(self):
377-
self.app.get('/admin', status=404)
378-
379367

380368
class TestNoAuthQuickStart(CommonTestQuickStart, unittest.TestCase):
381369

@@ -397,9 +385,6 @@ def setUp(self):
397385
def test_login(self):
398386
self.app.get('/login', status=404)
399387

400-
def test_unauthenticated_admin(self):
401-
self.app.get('/admin', status=404)
402-
403388

404389
class TestMingBQuickStart(CommonTestQuickStartWithAuth, unittest.TestCase):
405390

@@ -414,14 +399,6 @@ def setUp(self):
414399
super(TestMingBQuickStart, self).setUp()
415400

416401

417-
class TestNoTWQuickStart(CommonTestQuickStart, unittest.TestCase):
418-
419-
args = '--skip-tw'
420-
421-
def test_unauthenticated_admin(self):
422-
self.app.get('/admin', status=404)
423-
424-
425402
class TestMinimalQuickStart(CommonTestQuickStart, unittest.TestCase):
426403

427404
args = '--minimal-quickstart'

0 commit comments

Comments
 (0)