from django.conf.urls import patterns, url from apps.boards.views import BoardDetailView, BoardReportView, BoardListView urlpatterns = patterns('', url(r'^$', BoardListView.as_view(), name='board-list'), url(r'^(?P<pk>\d+)/$', BoardDetailView.as_view(), name='board-detail'), url(r'^(?P<pk>\d+)/report/$', BoardReportView.as_view(), name='board-report'), )
def test_should_have_Issued_from_that_board(self): issue_in_board = mommy.make(Issue, boardposition__board=self.board) mommy.make(BoardPosition, board=self.board, issue=issue_in_board) self.response = BoardReportView.as_view()(self.request, pk=self.board.pk) self.assertIn(issue_in_board, self.response.context_data["object_list"])
def test_should_hot_have_issues_from_Another_board(self): issue_in_other_board = mommy.make(Issue, boardposition__board=self.board) self.response = BoardReportView.as_view()(self.request, pk=self.board.pk) self.assertNotIn(issue_in_other_board, self.response.context_data["object_list"])
def get_view(self): return BoardReportView.as_view()