Project

General

Profile

0001-fix-form_receipt_datetime-type-13837.patch

Thomas Noël, 03 Nov 2016 12:04 PM

Download (1.9 KB)

View differences:

Subject: [PATCH] fix form_receipt_datetime type (#13837)

 tests/test_api.py      | 2 ++
 tests/test_formdata.py | 1 +
 wcs/formdata.py        | 2 +-
 3 files changed, 4 insertions(+), 1 deletion(-)
tests/test_api.py
1017 1017
    assert resp.json[0]['form_name'] == 'test'
1018 1018
    assert resp.json[0]['form_slug'] == 'test'
1019 1019
    assert resp.json[0]['form_status'] == 'New'
1020
    assert datetime.datetime.strptime(resp.json[0]['form_receipt_datetime'],
1021
                                      '%Y-%m-%dT%H:%M:%S')
1020 1022
    assert resp.json[0]['keywords'] == ['hello', 'world']
1021 1023
    assert resp.json == resp2.json == resp3.json
1022 1024

  
tests/test_formdata.py
116 116
    assert substvars.get('form_status_is_endpoint') == False
117 117
    assert substvars.get('form_receipt_date')
118 118
    assert substvars.get('form_receipt_time')
119
    assert substvars.get('form_receipt_datetime')
119 120
    assert substvars.get('form_evolution')
120 121

  
121 122
def test_field(pub):
wcs/formdata.py
482 482
                'form_criticality_level': self.criticality_level,
483 483
            })
484 484
            if self.receipt_time:
485
                d['form_receipt_datetime'] = datetime.datetime(*self.receipt_time[:6]),
485
                d['form_receipt_datetime'] = datetime.datetime(*self.receipt_time[:6])
486 486

  
487 487
        d['form_status'] = self.get_status_label()
488 488

  
489
-