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.
22 lines
887 B
22 lines
887 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'
|
|
|