Projet

Général

Profil

0001-tests-add-test-on-add-notification-endpoint-60643.patch

Nicolas Roche, 18 janvier 2022 19:26

Télécharger (1,12 ko)

Voir les différences:

Subject: [PATCH 1/2] tests: add test on add notification endpoint (#60643)

 tests/test_notification.py | 1 +
 1 file changed, 1 insertion(+)
tests/test_notification.py
268 268

  
269 269
    def notify(data):
270 270
        resp = client.post(reverse('api-notification-add'), json.dumps(data), content_type='application/json')
271 271

  
272 272
        return json.loads(force_text(resp.content))
273 273

  
274 274
    result = notify({'summary': 'foo', 'id': '1'})
275 275
    assert result['err'] == 1
276
    assert 'id must match regular expression' in result['err_desc']['id'][0]
276 277

  
277 278
    notification = Notification.notify(john_doe, 'foo')
278 279

  
279 280
    result = notify({'summary': 'foo', 'id': str(notification.id)})
280 281
    assert result['err'] == 0
281 282

  
282 283
    result = notify({'summary': 'foo', 'id': 'foo'})
283 284
    assert result['err'] == 1
284
-