Ejemplo n.º 1
0
    def test_request_create(self):
        request = RequestFactory().post(
                '/accounts/account-request/create/class',
                data={
                    'username':'******',
                    'password':'******',
                    'login_shell': '/bin/bash',
                    'course_number': 'CSCI4000',
                }
            )
        view = ClassAccountRequestCreateView.as_view()
        response = view(request)

        self.assertTrue(response.url.startswith('/accounts/account-request/review/'))

        ar = AccountRequest.objects.get(username='******')
        self.assertEquals(ar.first_name,'test')
        self.assertEquals(ar.last_name,'user')
        self.assertEquals(ar.email,'*****@*****.**')
        self.assertEquals(ar.role, 'student')
        self.assertEquals(ar.course_number, 'CSCI4000')
        self.assertEquals(ar.login_shell,'/bin/bash')
        self.assertEquals(ar.organization,'ucb')
Ejemplo n.º 2
0

urlpatterns = [
    url(
        r'^account-request/create$',
        ReasonView.as_view(),
        name='account-request-reason'
    ),
    url(
        r'^account-request/create/general$',
        AccountRequestCreateView.as_view(),
        name='account-request-create'
    ),
    url(
        r'^account-request/create/class$',
        ClassAccountRequestCreateView.as_view(),
        name='class-account-request-create'
    ),
    url(
        r'^account-request/create/sponsored$',
        SponsoredAccountRequestCreateView.as_view(),
        name='sponsored-account-request-create'
    ),
    url(
        r'^account-request/create/project$',
        ProjectAccountRequestCreateView.as_view(),
        name='project-account-request-create'
    ),
    url(
        r'^account-request/review/(?P<request_id>\d+)',
        AccountRequestReviewView.as_view(),