From 5a5b4ccb25b9b910e1198d6fdcbaa1faa484d712 Mon Sep 17 00:00:00 2001 From: Laetitia Getti Date: Thu, 30 Mar 2023 14:51:09 +0200 Subject: [PATCH] install flake8 and check files --- la_chariotte/order/models.py | 2 -- la_chariotte/order/tests/test_models.py | 2 +- la_chariotte/order/views.py | 4 ++-- readMe.md | 4 ++-- setup.cfg | 6 +++++- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/la_chariotte/order/models.py b/la_chariotte/order/models.py index 4088d2f..07051cb 100644 --- a/la_chariotte/order/models.py +++ b/la_chariotte/order/models.py @@ -1,5 +1,3 @@ -import datetime - from django.db import models from django.utils import timezone diff --git a/la_chariotte/order/tests/test_models.py b/la_chariotte/order/tests/test_models.py index b36d2e3..2f6d89e 100644 --- a/la_chariotte/order/tests/test_models.py +++ b/la_chariotte/order/tests/test_models.py @@ -13,7 +13,7 @@ class TestGroupedOrdersModel: """ deadline = timezone.now() + datetime.timedelta(days=10) ongoing_gr_order = Grouped_order(deadline=deadline) - assert ongoing_gr_order.is_ongoing() == True + assert ongoing_gr_order.is_ongoing() def test_is_ongoing_with_old_grouped_order(self): """ diff --git a/la_chariotte/order/views.py b/la_chariotte/order/views.py index 8a969c0..8ed7154 100644 --- a/la_chariotte/order/views.py +++ b/la_chariotte/order/views.py @@ -1,5 +1,5 @@ -from django.shortcuts import render, get_object_or_404, get_list_or_404 -from django.http import HttpResponse, Http404, HttpResponseRedirect +from django.shortcuts import render, get_object_or_404 +from django.http import HttpResponseRedirect from django.urls import reverse from django.utils import timezone from django.views import generic diff --git a/readMe.md b/readMe.md index 574c3ec..0b08ea9 100644 --- a/readMe.md +++ b/readMe.md @@ -2,9 +2,9 @@ La Chariotte est une application web sous licence libre Affera GPL, développée et maintenue par [Hashbang](https://hashbang.fr/). -## Lancer les tests +## Lancer les tests et linter -Avec pytest, +Lancer les tests avec pytest : ```bash pytest diff --git a/setup.cfg b/setup.cfg index fdfd88b..1183a37 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,6 @@ [tool:pytest] -DJANGO_SETTINGS_MODULE = la_chariotte.settings \ No newline at end of file +DJANGO_SETTINGS_MODULE = la_chariotte.settings + +[flake8] +exclude = migrations +extend-ignore = E501 \ No newline at end of file