@@ -233,11 +233,6 @@ def test_login(self):
233
233
resp = self .app .get ('/login' )
234
234
assert '<h1>Login</h1>' in resp
235
235
236
- def test_unauthenticated_admin (self ):
237
- assert (
238
- '<h1>Login</h1>' in self .app .get ('/admin/' , status = 302 ).follow ()
239
- )
240
-
241
236
def test_subtests (self ):
242
237
passed , failed , lines = get_passed_and_failed (self .env_cmd ,
243
238
self .python_cmd ,
@@ -270,35 +265,40 @@ def test_subtests(self):
270
265
271
266
272
267
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 )
275
275
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'
277
277
), resp1 .headers ['Location' ]
278
278
resp2 = resp1 .follow (extra_environ = {'SCRIPT_NAME' : '/prefix' })
279
279
assert '/prefix/login_handler' in resp2 , resp2
280
280
281
281
def test_login_with_prefix (self ):
282
282
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' ,
284
284
params = {'login' : 'editor' , 'password' : 'editpass' },
285
285
extra_environ = {'SCRIPT_NAME' : '/prefix' })
286
286
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'
288
288
), resp1 .headers ['Location' ]
289
289
resp2 = resp1 .follow (extra_environ = {'SCRIPT_NAME' : '/prefix' })
290
290
assert (
291
- resp2 .headers ['Location' ] == 'http://localhost/prefix/admin /'
291
+ resp2 .headers ['Location' ] == 'http://localhost/prefix/secc /'
292
292
), resp2 .headers ['Location' ]
293
293
294
294
def test_login_failure_with_prefix (self ):
295
295
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' ,
297
297
params = {'login' : 'WRONG' , 'password' : 'WRONG' },
298
298
extra_environ = {'SCRIPT_NAME' : '/prefix' })
299
299
location = resp .headers ['Location' ]
300
300
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
302
302
303
303
304
304
class TestDefaultQuickStart (CommonTestQuickStartWithAuth , unittest .TestCase ):
@@ -313,7 +313,7 @@ def setUp(self):
313
313
314
314
315
315
class TestMakoQuickStart (CommonTestQuickStart , unittest .TestCase ):
316
- args = '--mako --nosa --noauth --skip-tw '
316
+ args = '--mako --nosa --noauth'
317
317
318
318
pass_tests = ['/tests/functional/test_root.' ]
319
319
skip_tests = [
@@ -324,12 +324,9 @@ class TestMakoQuickStart(CommonTestQuickStart, unittest.TestCase):
324
324
def test_login (self ):
325
325
self .app .get ('/login' , status = 404 )
326
326
327
- def test_unauthenticated_admin (self ):
328
- self .app .get ('/admin' , status = 404 )
329
-
330
327
331
328
class TestGenshiQuickStart (CommonTestQuickStart , unittest .TestCase ):
332
- args = '--genshi --nosa --noauth --skip-tw '
329
+ args = '--genshi --nosa --noauth'
333
330
334
331
pass_tests = ['/tests/functional/test_root.' ]
335
332
skip_tests = [
@@ -340,12 +337,9 @@ class TestGenshiQuickStart(CommonTestQuickStart, unittest.TestCase):
340
337
def test_login (self ):
341
338
self .app .get ('/login' , status = 404 )
342
339
343
- def test_unauthenticated_admin (self ):
344
- self .app .get ('/admin' , status = 404 )
345
-
346
340
347
341
class TestJinjaQuickStart (CommonTestQuickStart , unittest .TestCase ):
348
- args = '--jinja --nosa --noauth --skip-tw '
342
+ args = '--jinja --nosa --noauth'
349
343
350
344
pass_tests = ['/tests/functional/test_root.' ]
351
345
skip_tests = [
@@ -356,9 +350,6 @@ class TestJinjaQuickStart(CommonTestQuickStart, unittest.TestCase):
356
350
def test_login (self ):
357
351
self .app .get ('/login' , status = 404 )
358
352
359
- def test_unauthenticated_admin (self ):
360
- self .app .get ('/admin' , status = 404 )
361
-
362
353
363
354
class TestNoDBQuickStart (CommonTestQuickStart , unittest .TestCase ):
364
355
@@ -368,14 +359,11 @@ class TestNoDBQuickStart(CommonTestQuickStart, unittest.TestCase):
368
359
'/tests/functional/test_authentication.' ,
369
360
'/tests/models/test_auth.' ]
370
361
371
- args = '--nosa --noauth --skip-tw '
362
+ args = '--nosa --noauth'
372
363
373
364
def test_login (self ):
374
365
self .app .get ('/login' , status = 404 )
375
366
376
- def test_unauthenticated_admin (self ):
377
- self .app .get ('/admin' , status = 404 )
378
-
379
367
380
368
class TestNoAuthQuickStart (CommonTestQuickStart , unittest .TestCase ):
381
369
@@ -397,9 +385,6 @@ def setUp(self):
397
385
def test_login (self ):
398
386
self .app .get ('/login' , status = 404 )
399
387
400
- def test_unauthenticated_admin (self ):
401
- self .app .get ('/admin' , status = 404 )
402
-
403
388
404
389
class TestMingBQuickStart (CommonTestQuickStartWithAuth , unittest .TestCase ):
405
390
@@ -414,14 +399,6 @@ def setUp(self):
414
399
super (TestMingBQuickStart , self ).setUp ()
415
400
416
401
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
-
425
402
class TestMinimalQuickStart (CommonTestQuickStart , unittest .TestCase ):
426
403
427
404
args = '--minimal-quickstart'
0 commit comments