From a0da0e5d022791fd7a947f1d6178e77e3cffa9ac Mon Sep 17 00:00:00 2001 From: Harouna Diallo Date: Fri, 14 Jan 2022 17:28:58 +0000 Subject: [PATCH 1/2] fix language for 'add another' --- examples/project/project/settings.py | 2 +- examples/project/project/urls.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/project/project/settings.py b/examples/project/project/settings.py index 9872f80..ed72b08 100644 --- a/examples/project/project/settings.py +++ b/examples/project/project/settings.py @@ -106,7 +106,7 @@ # Internationalization # https://docs.djangoproject.com/en/3.1/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = 'en-en' TIME_ZONE = 'UTC' diff --git a/examples/project/project/urls.py b/examples/project/project/urls.py index 1aca673..e1add07 100644 --- a/examples/project/project/urls.py +++ b/examples/project/project/urls.py @@ -16,6 +16,8 @@ from django.contrib import admin from django.urls import path +from app.views import home + urlpatterns = [ - path('admin/', admin.site.urls), + path('', home), ] From 887de3bf18dcfcc38e4b618704ca60c64de80ef2 Mon Sep 17 00:00:00 2001 From: Harouna Diallo Date: Fri, 14 Jan 2022 17:31:25 +0000 Subject: [PATCH 2/2] fix add Another --- examples/project/app/tests.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/project/app/tests.py b/examples/project/app/tests.py index 18ca6ae..9b1500f 100644 --- a/examples/project/app/tests.py +++ b/examples/project/app/tests.py @@ -54,7 +54,7 @@ def test_render_fieldset(self): def test_render_inline_fieldset(self): - InlineForm = inlineformset_factory(Student, Note, + InlineForm = inlineformset_factory(Student, Note, fields=('subject', 'value',), exclude=('pk',), can_delete=False, ) context = Context({'form': self.form, 'form_inline': InlineForm()}) @@ -95,5 +95,4 @@ def test_render_inline_fieldset(self): ## inline self.assertInHTML('

Note des eleves

', rendered) self.assertInHTML('', rendered) - self.assertInHTML('Ajout supplémentaire', rendered) - + self.assertInHTML('Add another', rendered)