''' 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'