Skip to content

Commit 87487d9

Browse files
committed
renamed timestamp fields
1 parent 7bc8cbc commit 87487d9

File tree

7 files changed

+95
-95
lines changed

7 files changed

+95
-95
lines changed

tests/test_ingredient.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -269,27 +269,27 @@ def test_offline_id(client: FlaskClient, auth_headers):
269269
assert response.status_code == 200 \
270270
and response.json['offline_id'] == offline_id
271271

272-
def test_create_update_date(client: FlaskClient, auth_headers):
272+
def test_create_update_timestamp(client: FlaskClient, auth_headers):
273273
response = create_ingredient(client, {
274274
'name': 'Rice',
275-
'creation_date': str(datetime.now())
275+
'insert_timestamp': str(datetime.now())
276276
}, auth_headers)
277277

278278
assert response.status_code == 403 \
279279
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
280280

281281
response = create_ingredient(client, {
282282
'name': 'Rice',
283-
'update_date': str(datetime.now())
283+
'update_timestamp': str(datetime.now())
284284
}, auth_headers)
285285

286286
assert response.status_code == 403 \
287287
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
288288

289289
response = create_ingredient(client, {
290290
'name': 'Rice',
291-
'update_date': str(datetime.now()),
292-
'creation_date': str(datetime.now())
291+
'update_timestamp': str(datetime.now()),
292+
'insert_timestamp': str(datetime.now())
293293
}, auth_headers)
294294

295295
assert response.status_code == 403 \
@@ -300,44 +300,44 @@ def test_create_update_date(client: FlaskClient, auth_headers):
300300
}, auth_headers)
301301

302302
assert response.status_code == 201 \
303-
and response.json['creation_date'] is not None \
304-
and isinstance(response.json['creation_date'], int) \
305-
and response.json['update_date'] is not None \
306-
and isinstance(response.json['update_date'], int)
303+
and response.json['insert_timestamp'] is not None \
304+
and isinstance(response.json['insert_timestamp'], int) \
305+
and response.json['update_timestamp'] is not None \
306+
and isinstance(response.json['update_timestamp'], int)
307307

308308
idx = response.json['_id']
309-
creation_date = response.json['creation_date']
310-
update_date = response.json['update_date']
309+
insert_timestamp = response.json['insert_timestamp']
310+
update_timestamp = response.json['update_timestamp']
311311

312312
response = put_ingredient(client, idx, {
313313
'name': 'Tomato',
314-
'update_date': str(datetime.now())
314+
'update_timestamp': str(datetime.now())
315315
}, auth_headers)
316316

317317
assert response.status_code == 403 \
318318
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
319319

320320
response = patch_ingredient(client, idx, {
321321
'name': 'Tomato',
322-
'creation_date': str(datetime.now())
322+
'insert_timestamp': str(datetime.now())
323323
}, auth_headers)
324324

325325
assert response.status_code == 403 \
326326
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
327327

328328
response = patch_ingredient(client, idx, {
329329
'name': 'Tomato',
330-
'creation_date': str(datetime.now()),
331-
'update_date': str(datetime.now())
330+
'insert_timestamp': str(datetime.now()),
331+
'update_timestamp': str(datetime.now())
332332
}, auth_headers)
333333

334334
assert response.status_code == 403 \
335335
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
336336

337337
response = put_ingredient(client, idx, {
338338
'name': 'Tomato',
339-
'creation_date': str(datetime.now()),
340-
'update_date': str(datetime.now())
339+
'insert_timestamp': str(datetime.now()),
340+
'update_timestamp': str(datetime.now())
341341
}, auth_headers)
342342

343343
assert response.status_code == 403 \
@@ -348,16 +348,16 @@ def test_create_update_date(client: FlaskClient, auth_headers):
348348
}, auth_headers)
349349

350350
assert response.status_code == 200 \
351-
and response.json['creation_date'] == creation_date \
352-
and response.json['update_date'] > update_date
351+
and response.json['insert_timestamp'] == insert_timestamp \
352+
and response.json['update_timestamp'] > update_timestamp
353353

354-
update_date = response.json['update_date']
354+
update_timestamp = response.json['update_timestamp']
355355

356356
response = put_ingredient(client, idx, {
357357
'name': 'Tomato',
358358
}, auth_headers)
359359

360360
assert response.status_code == 200 \
361361
and response.json['name'] == 'Tomato' \
362-
and response.json['creation_date'] == creation_date \
363-
and response.json['update_date'] > update_date
362+
and response.json['insert_timestamp'] == insert_timestamp \
363+
and response.json['update_timestamp'] > update_timestamp

tests/test_menu.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -345,27 +345,27 @@ def test_offline_id(client: FlaskClient, auth_headers):
345345
assert response.status_code == 200 \
346346
and response.json['offline_id'] == offline_id
347347

348-
def test_create_update_date(client: FlaskClient, auth_headers):
348+
def test_create_update_timestamp(client: FlaskClient, auth_headers):
349349
response = create_menu(client, {
350350
'date': '2019-02-14',
351-
'creation_date': str(datetime.now())
351+
'insert_timestamp': str(datetime.now())
352352
}, auth_headers)
353353

354354
assert response.status_code == 403 \
355355
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
356356

357357
response = create_menu(client, {
358358
'date': '2019-02-14',
359-
'update_date': str(datetime.now())
359+
'update_timestamp': str(datetime.now())
360360
}, auth_headers)
361361

362362
assert response.status_code == 403 \
363363
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
364364

365365
response = create_menu(client, {
366366
'date': '2019-02-14',
367-
'update_date': str(datetime.now()),
368-
'creation_date': str(datetime.now())
367+
'update_timestamp': str(datetime.now()),
368+
'insert_timestamp': str(datetime.now())
369369
}, auth_headers)
370370

371371
assert response.status_code == 403 \
@@ -376,44 +376,44 @@ def test_create_update_date(client: FlaskClient, auth_headers):
376376
}, auth_headers)
377377

378378
assert response.status_code == 201 \
379-
and response.json['creation_date'] is not None \
380-
and isinstance(response.json['creation_date'], int) \
381-
and response.json['update_date'] is not None \
382-
and isinstance(response.json['update_date'], int)
379+
and response.json['insert_timestamp'] is not None \
380+
and isinstance(response.json['insert_timestamp'], int) \
381+
and response.json['update_timestamp'] is not None \
382+
and isinstance(response.json['update_timestamp'], int)
383383

384384
idx = response.json['_id']
385-
creation_date = response.json['creation_date']
386-
update_date = response.json['update_date']
385+
insert_timestamp = response.json['insert_timestamp']
386+
update_timestamp = response.json['update_timestamp']
387387

388388
response = put_menu(client, idx, {
389389
'date': '2019-02-14',
390-
'update_date': str(datetime.now())
390+
'update_timestamp': str(datetime.now())
391391
}, auth_headers)
392392

393393
assert response.status_code == 403 \
394394
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
395395

396396
response = patch_menu(client, idx, {
397397
'date': '2019-02-14',
398-
'creation_date': str(datetime.now())
398+
'insert_timestamp': str(datetime.now())
399399
}, auth_headers)
400400

401401
assert response.status_code == 403 \
402402
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
403403

404404
response = patch_menu(client, idx, {
405405
'date': '2019-02-14',
406-
'creation_date': str(datetime.now()),
407-
'update_date': str(datetime.now())
406+
'insert_timestamp': str(datetime.now()),
407+
'update_timestamp': str(datetime.now())
408408
}, auth_headers)
409409

410410
assert response.status_code == 403 \
411411
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
412412

413413
response = put_menu(client, idx, {
414414
'date': '2019-02-14',
415-
'creation_date': str(datetime.now()),
416-
'update_date': str(datetime.now())
415+
'insert_timestamp': str(datetime.now()),
416+
'update_timestamp': str(datetime.now())
417417
}, auth_headers)
418418

419419
assert response.status_code == 403 \
@@ -424,16 +424,16 @@ def test_create_update_date(client: FlaskClient, auth_headers):
424424
}, auth_headers)
425425

426426
assert response.status_code == 200 \
427-
and response.json['creation_date'] == creation_date \
428-
and response.json['update_date'] > update_date
427+
and response.json['insert_timestamp'] == insert_timestamp \
428+
and response.json['update_timestamp'] > update_timestamp
429429

430-
update_date = response.json['update_date']
430+
update_timestamp = response.json['update_timestamp']
431431

432432
response = put_menu(client, idx, {
433433
'date': '2020-02-14',
434434
}, auth_headers)
435435

436436
assert response.status_code == 200 \
437437
and response.json['date'] == '2020-02-14' \
438-
and response.json['creation_date'] == creation_date \
439-
and response.json['update_date'] > update_date
438+
and response.json['insert_timestamp'] == insert_timestamp \
439+
and response.json['update_timestamp'] > update_timestamp

tests/test_recipe.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -221,27 +221,27 @@ def test_offline_id(client: FlaskClient, auth_headers):
221221
assert response.status_code == 200 \
222222
and response.json['offline_id'] == offline_id
223223

224-
def test_create_update_date(client: FlaskClient, auth_headers):
224+
def test_create_update_timestamp(client: FlaskClient, auth_headers):
225225
response = create_recipe(client, {
226226
'name': 'Rice',
227-
'creation_date': str(datetime.now())
227+
'insert_timestamp': str(datetime.now())
228228
}, auth_headers)
229229

230230
assert response.status_code == 403 \
231231
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
232232

233233
response = create_recipe(client, {
234234
'name': 'Rice',
235-
'update_date': str(datetime.now())
235+
'update_timestamp': str(datetime.now())
236236
}, auth_headers)
237237

238238
assert response.status_code == 403 \
239239
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
240240

241241
response = create_recipe(client, {
242242
'name': 'Rice',
243-
'update_date': str(datetime.now()),
244-
'creation_date': str(datetime.now())
243+
'update_timestamp': str(datetime.now()),
244+
'insert_timestamp': str(datetime.now())
245245
}, auth_headers)
246246

247247
assert response.status_code == 403 \
@@ -252,44 +252,44 @@ def test_create_update_date(client: FlaskClient, auth_headers):
252252
}, auth_headers)
253253

254254
assert response.status_code == 201 \
255-
and response.json['creation_date'] is not None \
256-
and isinstance(response.json['creation_date'], int) \
257-
and response.json['update_date'] is not None \
258-
and isinstance(response.json['update_date'], int)
255+
and response.json['insert_timestamp'] is not None \
256+
and isinstance(response.json['insert_timestamp'], int) \
257+
and response.json['update_timestamp'] is not None \
258+
and isinstance(response.json['update_timestamp'], int)
259259

260260
idx = response.json['_id']
261-
creation_date = response.json['creation_date']
262-
update_date = response.json['update_date']
261+
insert_timestamp = response.json['insert_timestamp']
262+
update_timestamp = response.json['update_timestamp']
263263

264264
response = put_recipe(client, idx, {
265265
'name': 'Tomato',
266-
'update_date': str(datetime.now())
266+
'update_timestamp': str(datetime.now())
267267
}, auth_headers)
268268

269269
assert response.status_code == 403 \
270270
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
271271

272272
response = patch_recipe(client, idx, {
273273
'name': 'Tomato',
274-
'creation_date': str(datetime.now())
274+
'insert_timestamp': str(datetime.now())
275275
}, auth_headers)
276276

277277
assert response.status_code == 403 \
278278
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
279279

280280
response = patch_recipe(client, idx, {
281281
'name': 'Tomato',
282-
'creation_date': str(datetime.now()),
283-
'update_date': str(datetime.now())
282+
'insert_timestamp': str(datetime.now()),
283+
'update_timestamp': str(datetime.now())
284284
}, auth_headers)
285285

286286
assert response.status_code == 403 \
287287
and response.json['error'] == 'CANNOT_SET_CREATION_UPDATE_TIME'
288288

289289
response = put_recipe(client, idx, {
290290
'name': 'Tomato',
291-
'creation_date': str(datetime.now()),
292-
'update_date': str(datetime.now())
291+
'insert_timestamp': str(datetime.now()),
292+
'update_timestamp': str(datetime.now())
293293
}, auth_headers)
294294

295295
assert response.status_code == 403 \
@@ -300,16 +300,16 @@ def test_create_update_date(client: FlaskClient, auth_headers):
300300
}, auth_headers)
301301

302302
assert response.status_code == 200 \
303-
and response.json['creation_date'] == creation_date \
304-
and response.json['update_date'] > update_date
303+
and response.json['insert_timestamp'] == insert_timestamp \
304+
and response.json['update_timestamp'] > update_timestamp
305305

306-
update_date = response.json['update_date']
306+
update_timestamp = response.json['update_timestamp']
307307

308308
response = put_recipe(client, idx, {
309309
'name': 'Tomato',
310310
}, auth_headers)
311311

312312
assert response.status_code == 200 \
313313
and response.json['name'] == 'Tomato' \
314-
and response.json['creation_date'] == creation_date \
315-
and response.json['update_date'] > update_date
314+
and response.json['insert_timestamp'] == insert_timestamp \
315+
and response.json['update_timestamp'] > update_timestamp

0 commit comments

Comments
 (0)