Beispiel #1
0
 def setUp(self):
     self._factory = RequestFactory()
     self._form_class = Mock(AddTaskForm)
     self._users_manager = Mock(User.objects)
     self._view = AddTaskView.as_view(
         form_class=self._form_class,
         users_manager=self._users_manager)
Beispiel #2
0
"""TaskManager URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/dev/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin

from tasks.views import LoginView, HomeView, AddTaskView, LogOutView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^add_task$', AddTaskView.as_view(), name="add_task"),
    url(r'^$', HomeView.as_view(), name="index"),
    url(r'^login/$', LoginView.as_view(), name="login"),
    url(r'^logout/$', LogOutView.as_view(), name="logout"),
]
Beispiel #3
0
from django.conf.urls import patterns, url
from tasks.views import TasksIndexView, SpecificTaskView, AddTaskView


urlpatterns = [
    url(  r'^todolist/tasks/$', TasksIndexView.as_view(), name='TasksView'),
    url(  r'^todolist/specifictask/$', SpecificTaskView.as_view(), name='SpecificTaskView'),
    url(  r'^tareas.(?P<id>.*)/$', AddTaskView.as_view(), name='AddTaskView'),
]
Beispiel #4
0
 def setUp(self):
     self._factory = RequestFactory()
     self._form_class = Mock(AddTaskForm)
     self._users_manager = Mock(User.objects)
     self._view = AddTaskView.as_view(form_class=self._form_class,
                                      users_manager=self._users_manager)