Browse Source

slug param in user_workspace

Guénaël Muller 6 years ago
parent
commit
4eff11bfc3
2 changed files with 2 additions and 1 deletions
  1. 1 0
      tracim/tests/functional/test_user.py
  2. 1 1
      tracim/views/core_api/schemas.py

+ 1 - 0
tracim/tests/functional/test_user.py View File

30
         workspace = res[0]
30
         workspace = res[0]
31
         assert workspace['id'] == 1
31
         assert workspace['id'] == 1
32
         assert workspace['label'] == 'Business'
32
         assert workspace['label'] == 'Business'
33
+        assert workspace['slug'] == 'business'
33
         assert len(workspace['sidebar_entries']) == 7
34
         assert len(workspace['sidebar_entries']) == 7
34
 
35
 
35
         sidebar_entry = workspace['sidebar_entries'][0]
36
         sidebar_entry = workspace['sidebar_entries'][0]

+ 1 - 1
tracim/views/core_api/schemas.py View File

188
 
188
 
189
 class WorkspaceDigestSchema(marshmallow.Schema):
189
 class WorkspaceDigestSchema(marshmallow.Schema):
190
     id = marshmallow.fields.Int(example=4)
190
     id = marshmallow.fields.Int(example=4)
191
+    slug = marshmallow.fields.String(example='intranet')
191
     label = marshmallow.fields.String(example='Intranet')
192
     label = marshmallow.fields.String(example='Intranet')
192
     sidebar_entries = marshmallow.fields.Nested(
193
     sidebar_entries = marshmallow.fields.Nested(
193
         WorkspaceMenuEntrySchema,
194
         WorkspaceMenuEntrySchema,
199
 
200
 
200
 
201
 
201
 class WorkspaceSchema(WorkspaceDigestSchema):
202
 class WorkspaceSchema(WorkspaceDigestSchema):
202
-    slug = marshmallow.fields.String(example='intranet')
203
     description = marshmallow.fields.String(example='All intranet data.')
203
     description = marshmallow.fields.String(example='All intranet data.')
204
 
204
 
205
     class Meta:
205
     class Meta: