server/python2/django/renkanmanager/tests/tests_workspace.py
author durandn
Tue, 26 Jan 2016 17:18:04 +0100
changeset 588 95536fa18d0d
parent 587 fb0041aa74d3
permissions -rw-r--r--
Minor adjustements to properly interact with Renkan client
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
     1
from django.core.urlresolvers import reverse
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
     2
from rest_framework.test import APITestCase
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
     3
from rest_framework import status
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
     4
from renkanmanager.models import Renkan, Workspace
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
     5
from django.contrib.auth import get_user_model
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
     6
import json
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
     7
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
     8
User = get_user_model()
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
     9
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    10
class WorkspaceTests(APITestCase):
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    11
    
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    12
    def setUp(self):
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    13
        User.objects.create_superuser("blop", "blop@blop.com", "blop")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    14
        self.user = User.objects.get(username="blop")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    15
        _ = self.client.login(username="blop", password="blop")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    16
        User.objects.create_user("blip", "blip@blip.com", "blip")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    17
        self.unauthorized_user = User.objects.get(username="blip")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    18
    
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    19
    def test_post_workspace(self):
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    20
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    21
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    22
        # POSTing test Workspace
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    23
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    24
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    25
        post_url = reverse("workspace_list")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    26
        test_title = "bleh_title"
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    27
        data = {"title": test_title}
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    28
        post_response = self.client.post(post_url, data, format="json")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    29
        post_response_dict = json.loads(post_response.content.decode())
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    30
        self.assertEqual(post_response.status_code, status.HTTP_201_CREATED)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    31
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    32
        # Checking data
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    33
        #    in the response
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    34
        self.assertEqual(post_response_dict.get("workspace_created_by"), self.user.username)
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    35
        self.assertEqual(post_response_dict.get("title"), test_title)
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    36
        #    in the database
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    37
        created_workspace_guid = post_response_dict.get("workspace_guid")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    38
        created_workspace = Workspace.objects.get(workspace_guid=created_workspace_guid)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    39
        self.assertEqual(created_workspace.creator.username, self.user.username)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    40
        self.assertEqual(created_workspace.title, test_title)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    41
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    42
        # Checking permission
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    43
        self.assertTrue(self.user.has_perm("view_workspace", created_workspace))
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    44
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    45
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    46
        # try POSTing with unauthorized user 
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    47
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    48
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    49
        _ = self.client.login(username="blip", password="blip")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    50
        post_url = reverse("workspace_list")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    51
        data = {"title": "wont_work"}
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    52
        post_response = self.client.post(post_url, data, format="json")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    53
        self.assertEqual(post_response.status_code, status.HTTP_403_FORBIDDEN)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    54
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    55
     
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    56
    def test_get_workspace_list(self):
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    57
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    58
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    59
        # POSTing new Workspaces
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    60
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    61
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    62
        post_url = reverse("workspace_list")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    63
        first_test_title = "bleh_title_2"
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    64
        second_test_title = "bleh_title_3"
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    65
        first_data = {"title": first_test_title}
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    66
        second_data = {"title": second_test_title}
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    67
        self.client.post(post_url, first_data, format="json")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    68
        self.client.post(post_url, second_data, format="json")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    69
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    70
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    71
        # GETting Workspaces
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    72
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    73
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    74
        get_url = post_url
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    75
        get_response = self.client.get(get_url, format=json)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    76
        self.assertEqual(get_response.status_code, status.HTTP_200_OK)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    77
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    78
        # Check data
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    79
        get_response_content = json.loads(get_response.content.decode()) # Should be a list
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    80
        self.assertTrue(isinstance(get_response_content, list))
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    81
        self.assertEqual(len(get_response_content), 2)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    82
    
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    83
    def test_get_workspace(self):
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    84
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    85
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    86
        # POSTing test Workspace
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    87
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    88
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    89
        workspace_post_url = reverse("workspace_list")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    90
        test_title = "bleh_title"
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    91
        data = {"title": test_title}
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    92
        post_response = self.client.post(workspace_post_url, data, format="json")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    93
        post_response_dict = json.loads(post_response.content.decode())
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
    94
        test_workspace_guid = post_response_dict.get("workspace_guid")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    95
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    96
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    97
        # POSTing new Renkans into test Workspace
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    98
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
    99
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   100
        renkan_post_url = reverse("renkan_list_workspace", kwargs={"workspace_guid": test_workspace_guid})
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   101
        first_test_title = "bleh_title"
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   102
        second_test_title = "bleh_title_2"
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   103
        first_data = {"title": first_test_title}
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   104
        second_data = {"title": second_test_title}
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   105
        self.client.post(renkan_post_url, first_data, format="json")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   106
        self.client.post(renkan_post_url, second_data, format="json")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   107
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   108
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   109
        # GETting test Workspace
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   110
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   111
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   112
        get_url = reverse("workspace_detail", kwargs={"workspace_guid": test_workspace_guid})
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   113
        get_response = self.client.get(get_url, format="json")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   114
        self.assertEqual(get_response.status_code, status.HTTP_200_OK)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   115
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   116
        # Checking GET data
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   117
        get_response_dict = json.loads(get_response.content.decode())
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   118
        self.assertEqual(test_workspace_guid, get_response_dict.get("workspace_guid", ""))
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   119
        self.assertEqual(test_title, get_response_dict.get("title", ""))
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   120
        self.assertEqual(self.user.username, get_response_dict.get("workspace_created_by", ""))
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   121
        self.assertEqual(2, get_response_dict.get("renkan_count"))
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   122
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   123
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   124
        # GETting wrong workspace_guid
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   125
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   126
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   127
        get_url = reverse("workspace_detail", kwargs={"workspace_guid": "bleh-bad-workspace-id"})
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   128
        get_response = self.client.get(get_url, format="json")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   129
        self.assertEqual(get_response.status_code, status.HTTP_404_NOT_FOUND)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   130
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   131
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   132
        # try GETting with unauthorized user 
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   133
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   134
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   135
        _ = self.client.login(username="blip", password="blip")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   136
        get_url = reverse("workspace_detail", kwargs={"workspace_guid": test_workspace_guid})
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   137
        get_response = self.client.get(get_url, format="json")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   138
        self.assertEqual(get_response.status_code, status.HTTP_403_FORBIDDEN)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   139
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   140
    def test_update_workspace(self):
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   141
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   142
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   143
        # POSTing test Workspace
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   144
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   145
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   146
        workspace_post_url = reverse("workspace_list")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   147
        test_title = "bleh_title"
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   148
        data = {"title": test_title}
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   149
        post_response = self.client.post(workspace_post_url, data, format="json")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   150
        post_response_dict = json.loads(post_response.content.decode())
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   151
        test_workspace_guid = post_response_dict.get("workspace_guid")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   152
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   153
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   154
        # PUTting into test Workspace
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   155
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   156
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   157
        put_url = reverse("workspace_detail", kwargs={"workspace_guid": test_workspace_guid})
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   158
        edited_title = "bleh_title_2"
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   159
        put_data = {"title": edited_title}
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   160
        put_response = self.client.put(put_url, put_data, format="json")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   161
        put_response_dict = json.loads(put_response.content.decode())
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   162
        self.assertEqual(put_response.status_code, status.HTTP_200_OK)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   163
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   164
        # Checking data
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   165
        #    in the response
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   166
        self.assertEqual(put_response_dict.get("workspace_created_by"), self.user.username)
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   167
        self.assertEqual(put_response_dict.get("title"), edited_title)
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   168
        self.assertEqual(put_response_dict.get("renkan_count"), 0)
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   169
        #    in the database
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   170
        edited_workspace_guid = put_response_dict.get("workspace_guid")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   171
        edited_workspace = Workspace.objects.get(workspace_guid=edited_workspace_guid)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   172
        self.assertEqual(edited_workspace.creator.username, self.user.username)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   173
        self.assertEqual(edited_workspace.title, edited_title)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   174
        self.assertEqual(edited_workspace.renkan_count, 0)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   175
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   176
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   177
        # try PUTting with unauthorized user 
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   178
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   179
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   180
        _ = self.client.login(username="blip", password="blip")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   181
        put_url = reverse("workspace_detail", kwargs={"workspace_guid": test_workspace_guid})
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   182
        put_data = {
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   183
            "title" : "wont_work"
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   184
        }
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   185
        put_response = self.client.put(put_url, put_data, format="json")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   186
        self.assertEqual(put_response.status_code, status.HTTP_403_FORBIDDEN)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   187
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   188
    def test_delete_workspace(self):
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   189
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   190
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   191
        # POSTing test Workspace
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   192
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   193
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   194
        workspace_post_url = reverse("workspace_list")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   195
        test_title = "bleh_title"
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   196
        data = {"title": test_title}
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   197
        post_response = self.client.post(workspace_post_url, data, format="json")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   198
        post_response_dict = json.loads(post_response.content.decode())
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   199
        to_delete_workspace_guid = post_response_dict.get("workspace_guid")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   200
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   201
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   202
        # POSTing new Renkan into test Workspace
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   203
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   204
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   205
        renkan_post_url = reverse("renkan_list_workspace", kwargs={"workspace_guid": to_delete_workspace_guid})
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   206
        renkan_test_title = "bleh_title"
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   207
        renkan_test_data = {"title": renkan_test_title}
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   208
        post_response = self.client.post(renkan_post_url, renkan_test_data, format="json")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   209
        to_delete_renkan_guid = json.loads(post_response.content.decode()).get("renkan_guid", "")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   210
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   211
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   212
        # Try to DELETE test Workspace (should fail, it still contains a Renkan)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   213
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   214
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   215
        delete_url = reverse("workspace_detail", kwargs={"workspace_guid":to_delete_workspace_guid})
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   216
        delete_response = self.client.delete(delete_url, {}, format="json")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   217
        self.assertEqual(delete_response.status_code, status.HTTP_400_BAD_REQUEST)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   218
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   219
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   220
        # DELETE posted Renkan
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   221
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   222
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   223
        delete_renkan_url = reverse("renkan_detail", kwargs={"renkan_guid":to_delete_renkan_guid})
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   224
        delete_renkan_response = self.client.delete(delete_renkan_url, format="json")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   225
        self.assertEqual(delete_renkan_response.status_code, status.HTTP_204_NO_CONTENT)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   226
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   227
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   228
        # try to DELETE with unauthorized user 
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   229
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   230
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   231
        _ = self.client.login(username="blip", password="blip")
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   232
        delete_url = reverse("workspace_detail", kwargs={"workspace_guid":to_delete_workspace_guid})
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   233
        delete_response = self.client.delete(delete_url, {}, format="json")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   234
        self.assertEqual(delete_response.status_code, status.HTTP_403_FORBIDDEN)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   235
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   236
        # Restoring rightful user
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   237
        _ = self.client.login(username="blop", password="blop")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   238
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   239
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   240
        # DELETE test Workspace 
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   241
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   242
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   243
        delete_url = reverse("workspace_detail", kwargs={"workspace_guid":to_delete_workspace_guid})
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   244
        delete_response = self.client.delete(delete_url, {}, format="json")
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   245
        self.assertEqual(delete_response.status_code, status.HTTP_204_NO_CONTENT)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   246
        
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   247
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   248
        # Try to DELETE workspace with wrong guid
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   249
        ###################################################
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   250
        
588
95536fa18d0d Minor adjustements to properly interact with Renkan client
durandn
parents: 587
diff changeset
   251
        delete_url = reverse("workspace_detail", kwargs={"workspace_guid": "bad-workspace-guid"})
587
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   252
        delete_response = self.client.delete(delete_url, format=json)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   253
        self.assertEqual(delete_response.status_code, status.HTTP_404_NOT_FOUND)
fb0041aa74d3 transfer work on renkanmanager into a renkan/server/python2 folder: reworked models, implemented simple API basic permissions, wrote tests
durandn
parents:
diff changeset
   254