tests: move superuser to pub fixture for category tests
This commit is contained in:
parent
bbe1b2a57f
commit
aa6e53a12f
|
@ -23,6 +23,8 @@ def pub(request):
|
|||
pub.cfg['language'] = {'language': 'en'}
|
||||
pub.write_cfg()
|
||||
|
||||
create_superuser(pub)
|
||||
|
||||
return pub
|
||||
|
||||
|
||||
|
@ -31,13 +33,11 @@ def teardown_module(module):
|
|||
|
||||
|
||||
def test_categories(pub):
|
||||
create_superuser(pub)
|
||||
app = login(get_app(pub))
|
||||
app.get('/backoffice/forms/categories/')
|
||||
|
||||
|
||||
def test_categories_legacy_urls(pub):
|
||||
create_superuser(pub)
|
||||
app = login(get_app(pub))
|
||||
resp = app.get('/backoffice/categories/')
|
||||
assert resp.location.endswith('/backoffice/forms/categories/')
|
||||
|
@ -48,7 +48,6 @@ def test_categories_legacy_urls(pub):
|
|||
|
||||
|
||||
def test_categories_new(pub):
|
||||
create_superuser(pub)
|
||||
Category.wipe()
|
||||
app = login(get_app(pub))
|
||||
|
||||
|
@ -75,7 +74,6 @@ def test_categories_new(pub):
|
|||
|
||||
|
||||
def test_categories_edit(pub):
|
||||
create_superuser(pub)
|
||||
Category.wipe()
|
||||
category = Category(name='foobar')
|
||||
category.store()
|
||||
|
@ -200,8 +198,6 @@ def test_categories_new_duplicate_name(pub):
|
|||
|
||||
|
||||
def test_categories_reorder(pub):
|
||||
create_superuser(pub)
|
||||
|
||||
Category.wipe()
|
||||
category = Category(name='foo')
|
||||
category.store()
|
||||
|
@ -223,8 +219,6 @@ def test_categories_reorder(pub):
|
|||
|
||||
|
||||
def test_categories_edit_roles(pub):
|
||||
create_superuser(pub)
|
||||
|
||||
pub.role_class.wipe()
|
||||
role_a = pub.role_class(name='a')
|
||||
role_a.store()
|
||||
|
|
Loading…
Reference in New Issue