Ejemplo n.º 1
0
    def test_logout_form_valid(self):

        data = {
            'origin_site': self.valid_site.pk,
            'next_url': '/',
        }

        self.request.method = 'POST'
        self.request.POST = data
        self.request.session = SessionStore()

        ViewClass = csrf_exempt(LogoutView.as_view())
        ViewClass(self.request, site_id=self.valid_site.pk)

        assert_equals(self.request.entree_user.__class__, AnonymousUser)
Ejemplo n.º 2
0
    def test_logout_form_valid(self):

        data = {
            'origin_site': self.valid_site.pk,
            'next_url': '/',
        }

        self.request.method = 'POST'
        self.request.POST = data
        self.request.session = SessionStore()

        ViewClass = csrf_exempt(LogoutView.as_view())
        ViewClass(self.request, site_id=self.valid_site.pk)

        assert_equals(self.request.entree_user.__class__, AnonymousUser)
Ejemplo n.º 3
0
    IdentityVerifyResend, RecoveryLoginView, PasswordResetView, PasswordRecoveryRequestView,
    FinishRecoveryView, PasswordChangeView, ShowApiView)

#TODO - cleanup
urlpatterns = patterns('entree.enauth.views',
    url(r'^api/show/(?P<site_id>\d+)/$', ShowApiView.as_view(), name='api_show'),
    url(r'^api/show/$', ShowApiView.as_view(), name='api_show'),
    url(r'^iframe-login/$', LoginHashView.as_view(), name='login_hash'),

    url(r'^login/recovery/(?P<origin_site>\d+)/$', RecoveryLoginView.as_view(), name='login-recovery'),

    url(r'^login/$', LoginView.as_view(), name='login'),  # dummy url
    url(r'^login/(?P<origin_site>\d+)/$', LoginView.as_view(), name='login'),
    url(r'^login/(?P<origin_site>\d+)/(?P<next_url>\S+)/$', LoginView.as_view(), name='login'),

    url(r'^logout/$', LogoutView.as_view(), name='logout'),  # dummy url
    url(r'^logout/(?P<origin_site>\d+)/$', LogoutView.as_view(), name='logout'),
    url(r'^logout/(?P<origin_site>\d+)/(?P<next_url>\S+)/$', LogoutView.as_view(), name='logout'),

    url(r'^register/$', CreateIdentityView.as_view(), name='register'),  # dummy url
    url(r'^register/(?P<origin_site>\d+)/$', CreateIdentityView.as_view(), name='register'),
    url(r'^register/(?P<origin_site>\d+)/(?P<next_url>\S+)/$', CreateIdentityView.as_view(), name='create_identity'),

    #each of these urls below should start w/ the same string
    #there's middleware which controls inactive account if: url.startswith(reverse('verify_identity'))
    url(r'^verify/$', IdentityVerifyView.as_view(), name='verify_identity'),
    url(r'^verify/(?P<email>[A-Za-z0-9=]+)/(?P<token>\w+)/$', IdentityVerifyView.as_view(), name='verify_identity'),

    url(r'^verify/resend/$', IdentityVerifyResend.as_view(), name='verify_resend'),
    # ^ each of these urls above should start w/ the same string
Ejemplo n.º 4
0
urlpatterns = patterns(
    'entree.enauth.views',
    url(r'^api/show/(?P<site_id>\d+)/$',
        ShowApiView.as_view(),
        name='api_show'),
    url(r'^api/show/$', ShowApiView.as_view(), name='api_show'),
    url(r'^iframe-login/$', LoginHashView.as_view(), name='login_hash'),
    url(r'^login/recovery/(?P<origin_site>\d+)/$',
        RecoveryLoginView.as_view(),
        name='login-recovery'),
    url(r'^login/$', LoginView.as_view(), name='login'),  #dummy url
    url(r'^login/(?P<origin_site>\d+)/$', LoginView.as_view(), name='login'),
    url(r'^login/(?P<origin_site>\d+)/(?P<next_url>\S+)/$',
        LoginView.as_view(),
        name='login'),
    url(r'^logout/$', LogoutView.as_view(), name='logout'),  #dummy url
    url(r'^logout/(?P<origin_site>\d+)/$', LogoutView.as_view(),
        name='logout'),
    url(r'^logout/(?P<origin_site>\d+)/(?P<next_url>\S+)/$',
        LogoutView.as_view(),
        name='logout'),
    url(r'^register/$', CreateIdentityView.as_view(),
        name='register'),  #dummy url
    url(r'^register/(?P<origin_site>\d+)/$',
        CreateIdentityView.as_view(),
        name='register'),
    url(r'^register/(?P<origin_site>\d+)/(?P<next_url>\S+)/$',
        CreateIdentityView.as_view(),
        name='create_identity'),

    #each of these urls below should start w/ the same string