|
@@ -113,11 +113,11 @@ class TestWebDav(StandardTest):
|
113
|
113
|
)
|
114
|
114
|
|
115
|
115
|
workspaces_names = [w.name for w in children]
|
116
|
|
- assert 'w1' in workspaces_names, \
|
117
|
|
- 'w1 should be in names ({0})'.format(
|
|
116
|
+ assert 'Recipes' in workspaces_names, \
|
|
117
|
+ 'Recipes should be in names ({0})'.format(
|
118
|
118
|
workspaces_names,
|
119
|
119
|
)
|
120
|
|
- assert 'w2' in workspaces_names, 'w2 should be in names ({0})'.format(
|
|
120
|
+ assert 'Others' in workspaces_names, 'Others should be in names ({0})'.format(
|
121
|
121
|
workspaces_names,
|
122
|
122
|
)
|
123
|
123
|
|
|
@@ -137,138 +137,138 @@ class TestWebDav(StandardTest):
|
137
|
137
|
eq_(
|
138
|
138
|
2,
|
139
|
139
|
len(children),
|
140
|
|
- msg='RootResource should return 2 workspaces instead {0}'.format(
|
|
140
|
+ msg='RootResource should return 3 workspaces instead {0}'.format(
|
141
|
141
|
len(children),
|
142
|
142
|
)
|
143
|
143
|
)
|
144
|
144
|
|
145
|
145
|
workspaces_names = [w.name for w in children]
|
146
|
|
- assert 'w1' in workspaces_names, 'w1 should be in names ({0})'.format(
|
|
146
|
+ assert 'Recipes' in workspaces_names, 'Recipes should be in names ({0})'.format(
|
147
|
147
|
workspaces_names,
|
148
|
148
|
)
|
149
|
|
- assert 'w3' in workspaces_names, 'w3 should be in names ({0})'.format(
|
|
149
|
+ assert 'Business' in workspaces_names, 'Business should be in names ({0})'.format(
|
150
|
150
|
workspaces_names,
|
151
|
151
|
)
|
152
|
152
|
|
153
|
153
|
def test_unit__list_workspace_folders__ok(self):
|
154
|
154
|
provider = self._get_provider(self.app_config)
|
155
|
|
- w1 = provider.getResourceInst(
|
156
|
|
- '/w1/',
|
|
155
|
+ Recipes = provider.getResourceInst(
|
|
156
|
+ '/Recipes/',
|
157
|
157
|
self._get_environ(
|
158
|
158
|
provider,
|
159
|
159
|
'bob@fsf.local',
|
160
|
160
|
)
|
161
|
161
|
)
|
162
|
|
- assert w1, 'Path /w1 should return a Wrkspace instance'
|
|
162
|
+ assert Recipes, 'Path /Recipes should return a Wrkspace instance'
|
163
|
163
|
|
164
|
|
- children = w1.getMemberList()
|
|
164
|
+ children = Recipes.getMemberList()
|
165
|
165
|
eq_(
|
166
|
166
|
2,
|
167
|
167
|
len(children),
|
168
|
|
- msg='w1 should list 2 folders instead {0}'.format(
|
|
168
|
+ msg='Recipes should list 2 folders instead {0}'.format(
|
169
|
169
|
len(children),
|
170
|
170
|
),
|
171
|
171
|
)
|
172
|
172
|
|
173
|
173
|
folders_names = [f.name for f in children]
|
174
|
|
- assert 'w1f1' in folders_names, 'w1f1 should be in names ({0})'.format(
|
|
174
|
+ assert 'Salads' in folders_names, 'Salads should be in names ({0})'.format(
|
175
|
175
|
folders_names,
|
176
|
176
|
)
|
177
|
|
- assert 'w1f2' in folders_names, 'w1f2 should be in names ({0})'.format(
|
|
177
|
+ assert 'Desserts' in folders_names, 'Desserts should be in names ({0})'.format(
|
178
|
178
|
folders_names,
|
179
|
179
|
)
|
180
|
180
|
|
181
|
181
|
def test_unit__list_content__ok(self):
|
182
|
182
|
provider = self._get_provider(self.app_config)
|
183
|
|
- w1f1 = provider.getResourceInst(
|
184
|
|
- '/w1/w1f1',
|
|
183
|
+ Salads = provider.getResourceInst(
|
|
184
|
+ '/Recipes/Desserts',
|
185
|
185
|
self._get_environ(
|
186
|
186
|
provider,
|
187
|
187
|
'bob@fsf.local',
|
188
|
188
|
)
|
189
|
189
|
)
|
190
|
|
- assert w1f1, 'Path /w1f1 should return a Wrkspace instance'
|
|
190
|
+ assert Salads, 'Path /Salads should return a Wrkspace instance'
|
191
|
191
|
|
192
|
|
- children = w1f1.getMemberList()
|
|
192
|
+ children = Salads.getMemberList()
|
193
|
193
|
eq_(
|
194
|
194
|
5,
|
195
|
195
|
len(children),
|
196
|
|
- msg='w1f1 should list 5 folders instead {0}'.format(
|
|
196
|
+ msg='Salads should list 5 Files instead {0}'.format(
|
197
|
197
|
len(children),
|
198
|
198
|
),
|
199
|
199
|
)
|
200
|
200
|
|
201
|
201
|
content_names = [c.name for c in children]
|
202
|
|
- assert 'w1f1p1.html' in content_names, \
|
203
|
|
- 'w1f1.html should be in names ({0})'.format(
|
|
202
|
+ assert 'Brownie Recipe.html' in content_names, \
|
|
203
|
+ 'Brownie Recipe.html should be in names ({0})'.format(
|
204
|
204
|
content_names,
|
205
|
205
|
)
|
206
|
206
|
|
207
|
|
- assert 'w1f1t1.html' in content_names,\
|
208
|
|
- 'w1f1t1.html should be in names ({0})'.format(
|
|
207
|
+ assert 'Best Cakes ʔ.html' in content_names,\
|
|
208
|
+ 'Best Cakes ʔ.html should be in names ({0})'.format(
|
209
|
209
|
content_names,
|
210
|
210
|
)
|
211
|
|
- assert 'w1f1d1.txt' in content_names,\
|
212
|
|
- 'w1f1d1.txt should be in names ({0})'.format(content_names,)
|
|
211
|
+ assert 'Apple_Pie.txt' in content_names,\
|
|
212
|
+ 'Apple_Pie.txt should be in names ({0})'.format(content_names,)
|
213
|
213
|
|
214
|
|
- assert 'w1f1f1' in content_names, \
|
215
|
|
- 'w1f1f1 should be in names ({0})'.format(
|
|
214
|
+ assert 'Fruits Desserts' in content_names, \
|
|
215
|
+ 'Fruits Desserts should be in names ({0})'.format(
|
216
|
216
|
content_names,
|
217
|
217
|
)
|
218
|
218
|
|
219
|
|
- assert 'w1f1d2.html' in content_names,\
|
220
|
|
- 'w1f1d2.html should be in names ({0})'.format(
|
|
219
|
+ assert 'Tiramisu Recipe.html' in content_names,\
|
|
220
|
+ 'Tiramisu Recipe.html should be in names ({0})'.format(
|
221
|
221
|
content_names,
|
222
|
222
|
)
|
223
|
223
|
|
224
|
224
|
def test_unit__get_content__ok(self):
|
225
|
225
|
provider = self._get_provider(self.app_config)
|
226
|
|
- w1f1d1 = provider.getResourceInst(
|
227
|
|
- '/w1/w1f1/w1f1d1.txt',
|
|
226
|
+ pie = provider.getResourceInst(
|
|
227
|
+ '/Recipes/Desserts/Apple_Pie.txt',
|
228
|
228
|
self._get_environ(
|
229
|
229
|
provider,
|
230
|
230
|
'bob@fsf.local',
|
231
|
231
|
)
|
232
|
232
|
)
|
233
|
233
|
|
234
|
|
- assert w1f1d1, 'w1f1d1 should be found'
|
235
|
|
- eq_('w1f1d1.txt', w1f1d1.name)
|
|
234
|
+ assert pie, 'Apple_Pie should be found'
|
|
235
|
+ eq_('Apple_Pie.txt', pie.name)
|
236
|
236
|
|
237
|
237
|
def test_unit__delete_content__ok(self):
|
238
|
238
|
provider = self._get_provider(self.app_config)
|
239
|
|
- w1f1d1 = provider.getResourceInst(
|
240
|
|
- '/w1/w1f1/w1f1d1.txt',
|
|
239
|
+ pie = provider.getResourceInst(
|
|
240
|
+ '/Recipes/Desserts/Apple_Pie.txt',
|
241
|
241
|
self._get_environ(
|
242
|
242
|
provider,
|
243
|
243
|
'bob@fsf.local',
|
244
|
244
|
)
|
245
|
245
|
)
|
246
|
246
|
|
247
|
|
- content_w1f1d1 = self.session.query(ContentRevisionRO) \
|
248
|
|
- .filter(Content.label == 'w1f1d1') \
|
|
247
|
+ content_pie = self.session.query(ContentRevisionRO) \
|
|
248
|
+ .filter(Content.label == 'Apple_Pie') \
|
249
|
249
|
.one() # It must exist only one revision, cf fixtures
|
250
|
250
|
eq_(
|
251
|
251
|
False,
|
252
|
|
- content_w1f1d1.is_deleted,
|
|
252
|
+ content_pie.is_deleted,
|
253
|
253
|
msg='Content should not be deleted !'
|
254
|
254
|
)
|
255
|
|
- content_w1f1d1_id = content_w1f1d1.content_id
|
|
255
|
+ content_pie_id = content_pie.content_id
|
256
|
256
|
|
257
|
|
- w1f1d1.delete()
|
|
257
|
+ pie.delete()
|
258
|
258
|
|
259
|
259
|
self.session.flush()
|
260
|
|
- content_w1f1d1 = self.session.query(ContentRevisionRO) \
|
261
|
|
- .filter(Content.content_id == content_w1f1d1_id) \
|
|
260
|
+ content_pie = self.session.query(ContentRevisionRO) \
|
|
261
|
+ .filter(Content.content_id == content_pie_id) \
|
262
|
262
|
.order_by(Content.revision_id.desc()) \
|
263
|
263
|
.first()
|
264
|
264
|
eq_(
|
265
|
265
|
True,
|
266
|
|
- content_w1f1d1.is_deleted,
|
|
266
|
+ content_pie.is_deleted,
|
267
|
267
|
msg='Content should be deleted !'
|
268
|
268
|
)
|
269
|
269
|
|
270
|
270
|
result = provider.getResourceInst(
|
271
|
|
- '/w1/w1f1/w1f1d1.txt',
|
|
271
|
+ '/Recipes/Desserts/Apple_Pie.txt',
|
272
|
272
|
self._get_environ(
|
273
|
273
|
provider,
|
274
|
274
|
'bob@fsf.local',
|
|
@@ -285,7 +285,7 @@ class TestWebDav(StandardTest):
|
285
|
285
|
'bob@fsf.local',
|
286
|
286
|
)
|
287
|
287
|
result = provider.getResourceInst(
|
288
|
|
- '/w1/w1f1/new_file.txt',
|
|
288
|
+ '/Recipes/Salads/greek_salad.txt',
|
289
|
289
|
environ,
|
290
|
290
|
)
|
291
|
291
|
|
|
@@ -296,17 +296,17 @@ class TestWebDav(StandardTest):
|
296
|
296
|
result = self._put_new_text_file(
|
297
|
297
|
provider,
|
298
|
298
|
environ,
|
299
|
|
- '/w1/w1f1/new_file.txt',
|
300
|
|
- b'hello\n',
|
|
299
|
+ '/Recipes/Salads/greek_salad.txt',
|
|
300
|
+ b'Greek Salad\n',
|
301
|
301
|
)
|
302
|
302
|
|
303
|
303
|
assert result, 'Result should not be None instead {0}'.format(
|
304
|
304
|
result
|
305
|
305
|
)
|
306
|
306
|
eq_(
|
307
|
|
- b'hello\n',
|
|
307
|
+ b'Greek Salad\n',
|
308
|
308
|
result.content.depot_file.file.read(),
|
309
|
|
- msg='fiel content should be "hello\n" but it is {0}'.format(
|
|
309
|
+ msg='fiel content should be "Greek Salad\n" but it is {0}'.format(
|
310
|
310
|
result.content.depot_file.file.read()
|
311
|
311
|
)
|
312
|
312
|
)
|
|
@@ -318,7 +318,7 @@ class TestWebDav(StandardTest):
|
318
|
318
|
'bob@fsf.local',
|
319
|
319
|
)
|
320
|
320
|
new_file = provider.getResourceInst(
|
321
|
|
- '/w1/w1f1/new_file.txt',
|
|
321
|
+ '/Recipes/Salads/greek_salad.txt',
|
322
|
322
|
environ,
|
323
|
323
|
)
|
324
|
324
|
|
|
@@ -330,15 +330,15 @@ class TestWebDav(StandardTest):
|
330
|
330
|
new_file = self._put_new_text_file(
|
331
|
331
|
provider,
|
332
|
332
|
environ,
|
333
|
|
- '/w1/w1f1/new_file.txt',
|
334
|
|
- b'hello\n',
|
|
333
|
+ '/Recipes/Salads/greek_salad.txt',
|
|
334
|
+ b'Greek Salad\n',
|
335
|
335
|
)
|
336
|
336
|
assert new_file, 'Result should not be None instead {0}'.format(
|
337
|
337
|
new_file
|
338
|
338
|
)
|
339
|
339
|
|
340
|
340
|
content_new_file = self.session.query(ContentRevisionRO) \
|
341
|
|
- .filter(Content.label == 'new_file') \
|
|
341
|
+ .filter(Content.label == 'greek_salad') \
|
342
|
342
|
.one() # It must exist only one revision
|
343
|
343
|
eq_(
|
344
|
344
|
False,
|
|
@@ -351,18 +351,18 @@ class TestWebDav(StandardTest):
|
351
|
351
|
new_file.delete()
|
352
|
352
|
|
353
|
353
|
self.session.flush()
|
354
|
|
- content_w1f1d1 = self.session.query(ContentRevisionRO) \
|
|
354
|
+ content_pie = self.session.query(ContentRevisionRO) \
|
355
|
355
|
.filter(Content.content_id == content_new_file_id) \
|
356
|
356
|
.order_by(Content.revision_id.desc()) \
|
357
|
357
|
.first()
|
358
|
358
|
eq_(
|
359
|
359
|
True,
|
360
|
|
- content_w1f1d1.is_deleted,
|
|
360
|
+ content_pie.is_deleted,
|
361
|
361
|
msg='Content should be deleted !'
|
362
|
362
|
)
|
363
|
363
|
|
364
|
364
|
result = provider.getResourceInst(
|
365
|
|
- '/w1/w1f1/new_file.txt',
|
|
365
|
+ '/Recipes/Salads/greek_salad.txt',
|
366
|
366
|
self._get_environ(
|
367
|
367
|
provider,
|
368
|
368
|
'bob@fsf.local',
|
|
@@ -376,8 +376,8 @@ class TestWebDav(StandardTest):
|
376
|
376
|
new_file = self._put_new_text_file(
|
377
|
377
|
provider,
|
378
|
378
|
environ,
|
379
|
|
- '/w1/w1f1/new_file.txt',
|
380
|
|
- b'hello\n',
|
|
379
|
+ '/Recipes/Salads/greek_salad.txt',
|
|
380
|
+ b'greek_salad\n',
|
381
|
381
|
)
|
382
|
382
|
assert new_file, 'Result should not be None instead {0}'.format(
|
383
|
383
|
new_file
|
|
@@ -385,19 +385,19 @@ class TestWebDav(StandardTest):
|
385
|
385
|
|
386
|
386
|
# Previous file is still dleeted
|
387
|
387
|
self.session.flush()
|
388
|
|
- content_w1f1d1 = self.session.query(ContentRevisionRO) \
|
|
388
|
+ content_pie = self.session.query(ContentRevisionRO) \
|
389
|
389
|
.filter(Content.content_id == content_new_file_id) \
|
390
|
390
|
.order_by(Content.revision_id.desc()) \
|
391
|
391
|
.first()
|
392
|
392
|
eq_(
|
393
|
393
|
True,
|
394
|
|
- content_w1f1d1.is_deleted,
|
|
394
|
+ content_pie.is_deleted,
|
395
|
395
|
msg='Content should be deleted !'
|
396
|
396
|
)
|
397
|
397
|
|
398
|
398
|
# And an other file exist for this name
|
399
|
399
|
content_new_new_file = self.session.query(ContentRevisionRO) \
|
400
|
|
- .filter(Content.label == 'new_file') \
|
|
400
|
+ .filter(Content.label == 'greek_salad') \
|
401
|
401
|
.order_by(Content.revision_id.desc()) \
|
402
|
402
|
.first()
|
403
|
403
|
assert content_new_new_file.content_id != content_new_file_id,\
|
|
@@ -415,29 +415,29 @@ class TestWebDav(StandardTest):
|
415
|
415
|
provider,
|
416
|
416
|
'bob@fsf.local',
|
417
|
417
|
)
|
418
|
|
- w1f1d1 = provider.getResourceInst(
|
419
|
|
- '/w1/w1f1/w1f1d1.txt',
|
|
418
|
+ pie = provider.getResourceInst(
|
|
419
|
+ '/Recipes/Desserts/Apple_Pie.txt',
|
420
|
420
|
environ,
|
421
|
421
|
)
|
422
|
422
|
|
423
|
|
- content_w1f1d1 = self.session.query(ContentRevisionRO) \
|
424
|
|
- .filter(Content.label == 'w1f1d1') \
|
|
423
|
+ content_pie = self.session.query(ContentRevisionRO) \
|
|
424
|
+ .filter(Content.label == 'Apple_Pie') \
|
425
|
425
|
.one() # It must exist only one revision, cf fixtures
|
426
|
|
- assert content_w1f1d1, 'w1f1d1 should be exist'
|
427
|
|
- content_w1f1d1_id = content_w1f1d1.content_id
|
|
426
|
+ assert content_pie, 'Apple_Pie should be exist'
|
|
427
|
+ content_pie_id = content_pie.content_id
|
428
|
428
|
|
429
|
|
- w1f1d1.moveRecursive('/w1/w1f1/w1f1d1_RENAMED.txt')
|
|
429
|
+ pie.moveRecursive('/Recipes/Desserts/Apple_Pie_RENAMED.txt')
|
430
|
430
|
|
431
|
431
|
# Database content is renamed
|
432
|
|
- content_w1f1d1 = self.session.query(ContentRevisionRO) \
|
433
|
|
- .filter(ContentRevisionRO.content_id == content_w1f1d1_id) \
|
|
432
|
+ content_pie = self.session.query(ContentRevisionRO) \
|
|
433
|
+ .filter(ContentRevisionRO.content_id == content_pie_id) \
|
434
|
434
|
.order_by(ContentRevisionRO.revision_id.desc()) \
|
435
|
435
|
.first()
|
436
|
436
|
eq_(
|
437
|
|
- 'w1f1d1_RENAMED',
|
438
|
|
- content_w1f1d1.label,
|
439
|
|
- msg='File should be labeled w1f1d1_RENAMED, not {0}'.format(
|
440
|
|
- content_w1f1d1.label
|
|
437
|
+ 'Apple_Pie_RENAMED',
|
|
438
|
+ content_pie.label,
|
|
439
|
+ msg='File should be labeled Apple_Pie_RENAMED, not {0}'.format(
|
|
440
|
+ content_pie.label
|
441
|
441
|
)
|
442
|
442
|
)
|
443
|
443
|
|
|
@@ -447,34 +447,34 @@ class TestWebDav(StandardTest):
|
447
|
447
|
provider,
|
448
|
448
|
'bob@fsf.local',
|
449
|
449
|
)
|
450
|
|
- w1f1d1 = provider.getResourceInst(
|
451
|
|
- '/w1/w1f1/w1f1d1.txt',
|
|
450
|
+ pie = provider.getResourceInst(
|
|
451
|
+ '/Recipes/Desserts/Apple_Pie.txt',
|
452
|
452
|
environ,
|
453
|
453
|
)
|
454
|
454
|
|
455
|
|
- content_w1f1d1 = self.session.query(ContentRevisionRO) \
|
456
|
|
- .filter(Content.label == 'w1f1d1') \
|
|
455
|
+ content_pie = self.session.query(ContentRevisionRO) \
|
|
456
|
+ .filter(Content.label == 'Apple_Pie') \
|
457
|
457
|
.one() # It must exist only one revision, cf fixtures
|
458
|
|
- assert content_w1f1d1, 'w1f1d1 should be exist'
|
459
|
|
- content_w1f1d1_id = content_w1f1d1.content_id
|
460
|
|
- content_w1f1d1_parent = content_w1f1d1.parent
|
|
458
|
+ assert content_pie, 'Apple_Pie should be exist'
|
|
459
|
+ content_pie_id = content_pie.content_id
|
|
460
|
+ content_pie_parent = content_pie.parent
|
461
|
461
|
eq_(
|
462
|
|
- content_w1f1d1_parent.label,
|
463
|
|
- 'w1f1',
|
464
|
|
- msg='field parent should be w1f1',
|
|
462
|
+ content_pie_parent.label,
|
|
463
|
+ 'Desserts',
|
|
464
|
+ msg='field parent should be Desserts',
|
465
|
465
|
)
|
466
|
466
|
|
467
|
|
- w1f1d1.moveRecursive('/w1/w1f2/w1f1d1.txt') # move in f2
|
|
467
|
+ pie.moveRecursive('/Recipes/Salads/Apple_Pie.txt') # move in f2
|
468
|
468
|
|
469
|
469
|
# Database content is moved
|
470
|
|
- content_w1f1d1 = self.session.query(ContentRevisionRO) \
|
471
|
|
- .filter(ContentRevisionRO.content_id == content_w1f1d1_id) \
|
|
470
|
+ content_pie = self.session.query(ContentRevisionRO) \
|
|
471
|
+ .filter(ContentRevisionRO.content_id == content_pie_id) \
|
472
|
472
|
.order_by(ContentRevisionRO.revision_id.desc()) \
|
473
|
473
|
.first()
|
474
|
474
|
|
475
|
|
- assert content_w1f1d1.parent.label != content_w1f1d1_parent.label,\
|
476
|
|
- 'file should be moved in w1f2 but is in {0}'.format(
|
477
|
|
- content_w1f1d1.parent.label
|
|
475
|
+ assert content_pie.parent.label != content_pie_parent.label,\
|
|
476
|
+ 'file should be moved in Salads but is in {0}'.format(
|
|
477
|
+ content_pie.parent.label
|
478
|
478
|
)
|
479
|
479
|
|
480
|
480
|
def test_unit__move_and_rename_content__ok(self):
|
|
@@ -483,39 +483,39 @@ class TestWebDav(StandardTest):
|
483
|
483
|
provider,
|
484
|
484
|
'bob@fsf.local',
|
485
|
485
|
)
|
486
|
|
- w1f1d1 = provider.getResourceInst(
|
487
|
|
- '/w1/w1f1/w1f1d1.txt',
|
|
486
|
+ pie = provider.getResourceInst(
|
|
487
|
+ '/Recipes/Desserts/Apple_Pie.txt',
|
488
|
488
|
environ,
|
489
|
489
|
)
|
490
|
490
|
|
491
|
|
- content_w1f1d1 = self.session.query(ContentRevisionRO) \
|
492
|
|
- .filter(Content.label == 'w1f1d1') \
|
|
491
|
+ content_pie = self.session.query(ContentRevisionRO) \
|
|
492
|
+ .filter(Content.label == 'Apple_Pie') \
|
493
|
493
|
.one() # It must exist only one revision, cf fixtures
|
494
|
|
- assert content_w1f1d1, 'w1f1d1 should be exist'
|
495
|
|
- content_w1f1d1_id = content_w1f1d1.content_id
|
496
|
|
- content_w1f1d1_parent = content_w1f1d1.parent
|
|
494
|
+ assert content_pie, 'Apple_Pie should be exist'
|
|
495
|
+ content_pie_id = content_pie.content_id
|
|
496
|
+ content_pie_parent = content_pie.parent
|
497
|
497
|
eq_(
|
498
|
|
- content_w1f1d1_parent.label,
|
499
|
|
- 'w1f1',
|
500
|
|
- msg='field parent should be w1f1',
|
|
498
|
+ content_pie_parent.label,
|
|
499
|
+ 'Desserts',
|
|
500
|
+ msg='field parent should be Desserts',
|
501
|
501
|
)
|
502
|
502
|
|
503
|
|
- w1f1d1.moveRecursive('/w1/w1f2/w1f1d1_RENAMED.txt')
|
|
503
|
+ pie.moveRecursive('/Others/Infos/Apple_Pie_RENAMED.txt')
|
504
|
504
|
|
505
|
505
|
# Database content is moved
|
506
|
|
- content_w1f1d1 = self.session.query(ContentRevisionRO) \
|
507
|
|
- .filter(ContentRevisionRO.content_id == content_w1f1d1_id) \
|
|
506
|
+ content_pie = self.session.query(ContentRevisionRO) \
|
|
507
|
+ .filter(ContentRevisionRO.content_id == content_pie_id) \
|
508
|
508
|
.order_by(ContentRevisionRO.revision_id.desc()) \
|
509
|
509
|
.first()
|
510
|
|
- assert content_w1f1d1.parent.label != content_w1f1d1_parent.label,\
|
511
|
|
- 'file should be moved in w1f2 but is in {0}'.format(
|
512
|
|
- content_w1f1d1.parent.label
|
|
510
|
+ assert content_pie.parent.label != content_pie_parent.label,\
|
|
511
|
+ 'file should be moved in Recipesf2 but is in {0}'.format(
|
|
512
|
+ content_pie.parent.label
|
513
|
513
|
)
|
514
|
514
|
eq_(
|
515
|
|
- 'w1f1d1_RENAMED',
|
516
|
|
- content_w1f1d1.label,
|
517
|
|
- msg='File should be labeled w1f1d1_RENAMED, not {0}'.format(
|
518
|
|
- content_w1f1d1.label
|
|
515
|
+ 'Apple_Pie_RENAMED',
|
|
516
|
+ content_pie.label,
|
|
517
|
+ msg='File should be labeled Apple_Pie_RENAMED, not {0}'.format(
|
|
518
|
+ content_pie.label
|
519
|
519
|
)
|
520
|
520
|
)
|
521
|
521
|
|
|
@@ -526,23 +526,23 @@ class TestWebDav(StandardTest):
|
526
|
526
|
'bob@fsf.local',
|
527
|
527
|
)
|
528
|
528
|
content_to_move_res = provider.getResourceInst(
|
529
|
|
- '/w1/w1f1/w1f1d1.txt',
|
|
529
|
+ '/Recipes/Desserts/Apple_Pie.txt',
|
530
|
530
|
environ,
|
531
|
531
|
)
|
532
|
532
|
|
533
|
533
|
content_to_move = self.session.query(ContentRevisionRO) \
|
534
|
|
- .filter(Content.label == 'w1f1d1') \
|
|
534
|
+ .filter(Content.label == 'Apple_Pie') \
|
535
|
535
|
.one() # It must exist only one revision, cf fixtures
|
536
|
|
- assert content_to_move, 'w1f1d1 should be exist'
|
|
536
|
+ assert content_to_move, 'Apple_Pie should be exist'
|
537
|
537
|
content_to_move_id = content_to_move.content_id
|
538
|
538
|
content_to_move_parent = content_to_move.parent
|
539
|
539
|
eq_(
|
540
|
540
|
content_to_move_parent.label,
|
541
|
|
- 'w1f1',
|
542
|
|
- msg='field parent should be w1f1',
|
|
541
|
+ 'Desserts',
|
|
542
|
+ msg='field parent should be Desserts',
|
543
|
543
|
)
|
544
|
544
|
|
545
|
|
- content_to_move_res.moveRecursive('/w2/w2f1/w1f1d1.txt') # move in w2, f1
|
|
545
|
+ content_to_move_res.moveRecursive('/Others/Infos/Apple_Pie.txt') # move in Business, f1
|
546
|
546
|
|
547
|
547
|
# Database content is moved
|
548
|
548
|
content_to_move = self.session.query(ContentRevisionRO) \
|
|
@@ -552,8 +552,8 @@ class TestWebDav(StandardTest):
|
552
|
552
|
|
553
|
553
|
assert content_to_move.parent, 'Content should have a parent'
|
554
|
554
|
|
555
|
|
- assert content_to_move.parent.label == 'w2f1',\
|
556
|
|
- 'file should be moved in w2f1 but is in {0}'.format(
|
|
555
|
+ assert content_to_move.parent.label == 'Infos',\
|
|
556
|
+ 'file should be moved in Infos but is in {0}'.format(
|
557
|
557
|
content_to_move.parent.label
|
558
|
558
|
)
|
559
|
559
|
|
|
@@ -564,7 +564,7 @@ class TestWebDav(StandardTest):
|
564
|
564
|
'bob@fsf.local',
|
565
|
565
|
)
|
566
|
566
|
result = provider.getResourceInst(
|
567
|
|
- '/w1/w1f1/new_file.txt',
|
|
567
|
+ '/Recipes/Salads/greek_salad.txt',
|
568
|
568
|
environ,
|
569
|
569
|
)
|
570
|
570
|
|
|
@@ -575,7 +575,7 @@ class TestWebDav(StandardTest):
|
575
|
575
|
result = self._put_new_text_file(
|
576
|
576
|
provider,
|
577
|
577
|
environ,
|
578
|
|
- '/w1/w1f1/new_file.txt',
|
|
578
|
+ '/Recipes/Salads/greek_salad.txt',
|
579
|
579
|
b'hello\n',
|
580
|
580
|
)
|
581
|
581
|
|