misc: fix misplaced-comparison-constant pylint error (#55505)

This commit is contained in:
Lauréline Guérin 2021-07-09 17:50:07 +02:00
parent 5fd955989c
commit 05c6d6b26b
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
4 changed files with 6 additions and 5 deletions

View File

@ -102,8 +102,8 @@ def test_datetime_api_label(app):
agenda=agenda,
)
resp = app.get('/api/agenda/%s/datetimes/' % agenda.slug)
assert 'Hello world' == resp.json['data'][0]['text']
assert 'Hello world' == resp.json['data'][0]['label']
assert resp.json['data'][0]['text'] == 'Hello world'
assert resp.json['data'][0]['label'] == 'Hello world'
agenda.event_display_template = '{{ event.label }} - {{ event.start_datetime }}'
agenda.save()

View File

@ -254,7 +254,7 @@ def test_unavailability_calendar_edit_time_period_exeptions(app, admin_user):
resp = resp.form.submit().follow()
assert 'Exception foo' in resp.text
time_period_exception.refresh_from_db()
assert 'Exception foo' == time_period_exception.label
assert time_period_exception.label == 'Exception foo'
# with an error
resp = app.get('/manage/time-period-exceptions/%s/edit' % time_period_exception.pk)

View File

@ -513,7 +513,7 @@ def test_timeperiodexception_creation_from_ics_without_startdt():
source = desk.timeperiodexceptionsource_set.create(ics_filename='sample.ics', ics_file=ics_sample)
with pytest.raises(ICSError) as e:
source._check_ics_content()
assert 'Event "Événement 1" has no start date.' == str(e.value)
assert str(e.value) == 'Event "Événement 1" has no start date.'
def test_timeperiodexception_creation_from_ics_without_enddt():

View File

@ -84,4 +84,5 @@ def test_interval_set_eq():
assert IntervalSet([(1, 2)]) == [(1, 2)]
assert [(1, 2)] == IntervalSet([(1, 2)])
assert not IntervalSet([(1, 2)]) == None # noqa pylint: disable=singleton-comparison
assert not None == IntervalSet([(1, 2)]) # noqa pylint: disable=singleton-comparison
# noqa pylint: disable=singleton-comparison,misplaced-comparison-constant
assert not None == IntervalSet([(1, 2)])