Exemplo n.º 1
0
 def test_review_user_view_not_staff(self):
     user = UserFactory.create()
     book = BookFactory.create()
     bookowner = BookOwnerFactory.create(user=user,book=book)
     self.request.user = user
     self.request.current_book = book
     response = ReviewUserView.as_view()(self.request)
     self.assertEqual(response.status_code, 302)
Exemplo n.º 2
0
 def test_review_user_view_renders(self):
     user = UserFactory.create()
     user.is_staff = True
     book = BookFactory.create()
     bookowner = BookOwnerFactory.create(user=user,book=book)
     self.request.user = user
     self.request.current_book = book
     response = ReviewUserView.as_view()(self.request)
     response.render()
Exemplo n.º 3
0
 def test_review_user_view_not_staff(self):
     user = UserFactory.create()
     self.request.user = user
     response = ReviewUserView.as_view()(self.request)
     self.assertEqual(response.status_code, 302)
Exemplo n.º 4
0
 def test_review_user_view_200(self):
     user = UserFactory.create()
     user.is_staff = True
     self.request.user = user
     response = ReviewUserView.as_view()(self.request)
     response.render()
Exemplo n.º 5
0
 def test_review_user_view_200(self):
     user = UserFactory.create()
     user.is_staff = True
     self.request.user = user
     response = ReviewUserView.as_view()(self.request)
     self.assertEqual(response.status_code, 200)
Exemplo n.º 6
0
from profiles.views import ReviewUserView

admin.autodiscover()

urlpatterns = [
    url(r'^api/', include(api_urls)),
    url(r'^tags/', include(tag_urls)),
    url(r'^log/', include(log_urls)),
    url(r'^allauth_login/', allauth_views.login, name='account_login'),
    url(r'^signup/', allauth_views.signup, name='account_signup'),
    url(
        r'^hold/',
        TemplateView.as_view(template_name='signup_success.html'),
        name='account_inactive',
    ),
    url(r'^admin/dashboard', ReviewUserView.as_view()),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^invites/add$', CreateInviteView.as_view(), name='create-invite'),
    url(
        r'^invites/accept/(?P<key>[\w-]+)/$',
        AcceptInviteView.as_view(),
        name='accept-invite',
    ),
    url(r'^u/', include('profiles.urls')),
    url(
        r'^policies$',
        TemplateView.as_view(template_name='policies.html'),
        name='policies',
    ),
    url(r'^', include(contact_urls)),
Exemplo n.º 7
0
 def test_review_user_view_not_staff(self):
     user = UserFactory.create()
     self.request.user = user
     response = ReviewUserView.as_view()(self.request)
     self.assertEqual(response.status_code, 302)
Exemplo n.º 8
0
 def test_review_user_view_200(self):
     user = UserFactory.create()
     user.is_staff = True
     self.request.user = user
     response = ReviewUserView.as_view()(self.request)
     response.render()
Exemplo n.º 9
0
 def test_review_user_view_200(self):
     user = UserFactory.create()
     user.is_staff = True
     self.request.user = user
     response = ReviewUserView.as_view()(self.request)
     self.assertEqual(response.status_code, 200)
Exemplo n.º 10
0
admin.autodiscover()
gargoyle.autodiscover()

urlpatterns = [
    url(r'^api/', include(api_urls)),
    url(r'^tags/', include(tag_urls)),
    url(r'^log/', include(log_urls)),
    url(r'^allauth_login/', allauth_views.login, name='account_login'),
    url(r'^login/', allauth_views.login, name='login'),
    url(r'^signup/', allauth_views.signup, name='account_signup'),
    url(
        r'^hold/',
        TemplateView.as_view(template_name='signup_success.html'),
        name='account_inactive',
    ),
    url(r'^admin/dashboard', ReviewUserView.as_view()),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^nexus/', include(nexus.site.urls)),
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^invites/add$', CreateInviteView.as_view(), name='create-invite'),
    url(
        r'^invites/accept/(?P<key>[\w-]+)/$',
        AcceptInviteView.as_view(),
        name='accept-invite',
    ),
    url(r'^u/', include('profiles.urls')),
    url(
        r'^policies$', 
        TemplateView.as_view(template_name='policies.html'),
        name='policies',
    ),