misc: enable pylint for tests, fix warnings (#83980)
gitea/lingo/pipeline/head This commit looks good
Details
gitea/lingo/pipeline/head This commit looks good
Details
This commit is contained in:
parent
919b43df4f
commit
71d23268da
|
@ -163,8 +163,8 @@ def test_refresh_agendas(mock_collect):
|
||||||
agenda1.category_slug = 'foo'
|
agenda1.category_slug = 'foo'
|
||||||
agenda1.save()
|
agenda1.save()
|
||||||
agenda2.label = 'Wrong'
|
agenda2.label = 'Wrong'
|
||||||
agenda2.category_label is None
|
agenda2.category_label = None
|
||||||
agenda2.category_slug is None
|
agenda2.category_slug = None
|
||||||
agenda2.save()
|
agenda2.save()
|
||||||
refresh_agendas()
|
refresh_agendas()
|
||||||
assert Agenda.objects.count() == 2
|
assert Agenda.objects.count() == 2
|
||||||
|
|
|
@ -10,9 +10,9 @@ pytestmark = pytest.mark.django_db
|
||||||
|
|
||||||
def test_statistics_list(app, user):
|
def test_statistics_list(app, user):
|
||||||
regie = Regie.objects.create(label='Regie 1')
|
regie = Regie.objects.create(label='Regie 1')
|
||||||
agenda = Agenda.objects.create(label='Activity 1', regie=regie)
|
Agenda.objects.create(label='Activity 1', regie=regie)
|
||||||
|
|
||||||
regie2 = Regie.objects.create(label='Regie 2')
|
Regie.objects.create(label='Regie 2')
|
||||||
|
|
||||||
# unauthorized
|
# unauthorized
|
||||||
app.get('/api/statistics/', status=403)
|
app.get('/api/statistics/', status=403)
|
||||||
|
|
|
@ -1209,21 +1209,20 @@ def test_get_pricing_data(context):
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
agenda_pricing.agendas.add(agenda)
|
agenda_pricing.agendas.add(agenda)
|
||||||
for subscription in [None, {'foo': 'bar'}]:
|
assert agenda_pricing.get_pricing_data(
|
||||||
assert agenda_pricing.get_pricing_data(
|
request=context['request'],
|
||||||
request=context['request'],
|
pricing_date=datetime.date(year=2021, month=9, day=1),
|
||||||
pricing_date=datetime.date(year=2021, month=9, day=1),
|
user_external_id='child:42',
|
||||||
user_external_id='child:42',
|
payer_external_id='parent:35',
|
||||||
payer_external_id='parent:35',
|
) == {
|
||||||
) == {
|
'pricing': 42,
|
||||||
|
'calculation_details': {
|
||||||
'pricing': 42,
|
'pricing': 42,
|
||||||
'calculation_details': {
|
'criterias': {'foo': 'bar'},
|
||||||
'pricing': 42,
|
'reduction_rate': {},
|
||||||
'criterias': {'foo': 'bar'},
|
'context': {'domicile': 'commune', 'qf': '2'},
|
||||||
'reduction_rate': {},
|
},
|
||||||
'context': {'domicile': 'commune', 'qf': '2'},
|
}
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def test_get_pricing_data_for_event(context):
|
def test_get_pricing_data_for_event(context):
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -65,7 +65,7 @@ deps =
|
||||||
git+https://git.entrouvert.org/entrouvert/debian-django-ckeditor.git
|
git+https://git.entrouvert.org/entrouvert/debian-django-ckeditor.git
|
||||||
commands =
|
commands =
|
||||||
./getlasso3.sh
|
./getlasso3.sh
|
||||||
./pylint.sh lingo/
|
./pylint.sh lingo/ tests/
|
||||||
|
|
||||||
[testenv:bandit]
|
[testenv:bandit]
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
|
|
Loading…
Reference in New Issue