CPI Ordering System (the old version)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 

23 lines
888 B

''' Tests for the account resources '''
from pyramid.testing import DummyRequest
def test_registration_acl():
from pyramid.security import Allow, Everyone, DENY_ALL
from ordr.resources.account import RegistrationResource
resource = RegistrationResource('some request', 'a name', 'the parent')
assert resource.__acl__() == [(Allow, Everyone, 'view'), DENY_ALL]
def test_registration_get_registration_form():
from pyramid.security import Allow, Everyone, DENY_ALL
from ordr.resources.account import RegistrationResource
import deform
request = DummyRequest()
resource = RegistrationResource(request, 'a name', 'the parent')
form = resource.get_registration_form()
assert isinstance(form, deform.Form)
assert len(form.buttons) == 2
assert form.buttons[0].title == 'Create Account'
assert form.buttons[1].title == 'Cancel'