Browse Source

add tests for the admin form if used by registered/admin users

Natenom/support-murmur-13-1446181288462
Michael Ziegler 14 years ago
parent
commit
f680d2a59b
  1. 26
      pyweb/mumble/tests.py

26
pyweb/mumble/tests.py

@ -168,8 +168,10 @@ RES_SUCCESS = {'success': True}
RES_ACCESSDENIED = {'success': False, 'errors': {'': 'access denied'}}
RES_PREVALFAIL = {'success': False, 'errors': {'': 'pre-validation failed'}}
LOGIN_SUPERADMIN = {'username': 'svedrin', 'password': 'passwort'}
LOGIN_UNREGUSER = {'username': 'nocheinuser', 'password': 'passwort'}
LOGIN_SUPERADMIN = {'username': 'svedrin', 'password': 'passwort'}
LOGIN_UNREGUSER = {'username': 'unreg', 'password': 'passwort'}
LOGIN_USER = {'username': 'user', 'password': 'passwort'}
LOGIN_ADMIN = {'username': 'admin', 'password': 'passwort'}
#############################################################
### ANON: Unauthed (not logged in) users ###
@ -248,10 +250,30 @@ Unreg_Administration = generateTestCase(
### USER: MumbleUser but not a server admin ###
#############################################################
User_Administration = generateTestCase(
name = "User_Administration",
formname = "MumbleForm",
data = {
'My': ( {'pk': 1, 'name': 'test server', 'url': '', 'player': ''}, RES_ACCESSDENIED ),
'Other': ( {'pk': 2, 'name': 'alealejandro', 'url': '', 'player': ''}, RES_ACCESSDENIED ),
},
login = LOGIN_USER,
)
#############################################################
### ADMIN: MumbleUser is a server admin ###
#############################################################
Admin_Administration = generateTestCase(
name = "Admin_Administration",
formname = "MumbleForm",
data = {
'My': ( {'pk': 1, 'name': 'test server', 'url': '', 'player': ''}, RES_SUCCESS ),
'Other': ( {'pk': 2, 'name': 'alealejandro', 'url': '', 'player': ''}, RES_ACCESSDENIED ),
},
login = LOGIN_ADMIN,
)
#############################################################
### SUPER: User is superadmin, MumbleUser irrelevant ###
#############################################################

Loading…
Cancel
Save