From c433e6a1bc00a7a141c1f0b13ca21161efb032b5 Mon Sep 17 00:00:00 2001 From: victor felder Date: Sun, 6 Aug 2017 16:34:56 +0200 Subject: [PATCH] overrided -> overridden :/ (#4452) --- zds/member/tests/tests_models.py | 8 +-- zds/member/tests/tests_views.py | 8 +-- .../tests_setlastvisitmiddleware.py | 6 +- zds/notification/tests/tests_tricky.py | 20 +++---- zds/searchv2/tests/tests_models.py | 8 +-- zds/searchv2/tests/tests_utils.py | 8 +-- zds/searchv2/tests/tests_views.py | 8 +-- zds/settings.py | 2 +- zds/tutorialv2/api/tests.py | 12 ++-- zds/tutorialv2/publication_utils.py | 2 +- zds/tutorialv2/tests/tests_feeds.py | 54 ++++++++--------- zds/tutorialv2/tests/tests_lists.py | 26 ++++---- zds/tutorialv2/tests/tests_models.py | 20 +++---- zds/tutorialv2/tests/tests_move.py | 24 ++++---- zds/tutorialv2/tests/tests_opinion_views.py | 22 +++---- zds/tutorialv2/tests/tests_utils.py | 34 +++++------ zds/tutorialv2/tests/tests_views.py | 60 +++++++++---------- zds/utils/templatetags/tests/test_top_tags.py | 20 +++---- 18 files changed, 171 insertions(+), 171 deletions(-) diff --git a/zds/member/tests/tests_models.py b/zds/member/tests/tests_models.py index d5a611fb16..1774722c31 100644 --- a/zds/member/tests/tests_models.py +++ b/zds/member/tests/tests_models.py @@ -20,13 +20,13 @@ from zds.utils.models import Alert from copy import deepcopy -overrided_zds_app = deepcopy(settings.ZDS_APP) -overrided_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') -overrided_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') @override_settings(MEDIA_ROOT=os.path.join(settings.BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) class MemberModelsTest(TestCase): def setUp(self): diff --git a/zds/member/tests/tests_views.py b/zds/member/tests/tests_views.py index 48f0bed19c..819c171c89 100644 --- a/zds/member/tests/tests_views.py +++ b/zds/member/tests/tests_views.py @@ -30,13 +30,13 @@ from zds.utils.models import CommentVote, Hat from copy import deepcopy -overrided_zds_app = deepcopy(settings.ZDS_APP) -overrided_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') -overrided_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') @override_settings(MEDIA_ROOT=os.path.join(settings.BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) class MemberTests(TestCase): def setUp(self): diff --git a/zds/middlewares/tests_setlastvisitmiddleware.py b/zds/middlewares/tests_setlastvisitmiddleware.py index 56478135be..115dce40ac 100644 --- a/zds/middlewares/tests_setlastvisitmiddleware.py +++ b/zds/middlewares/tests_setlastvisitmiddleware.py @@ -12,11 +12,11 @@ from django.conf import settings from copy import deepcopy -overriden_zds_app = deepcopy(settings.ZDS_APP) -overriden_zds_app['member']['update_last_visit_interval'] = 30 +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['member']['update_last_visit_interval'] = 30 -@override_settings(ZDS_APP=overriden_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) class SetLastVisitMiddlewareTest(TestCase): def setUp(self): self.user = ProfileFactory() diff --git a/zds/notification/tests/tests_tricky.py b/zds/notification/tests/tests_tricky.py index f2459f2b47..4c567e73c6 100644 --- a/zds/notification/tests/tests_tricky.py +++ b/zds/notification/tests/tests_tricky.py @@ -68,20 +68,20 @@ def test_no_dead_notif_on_moving(self): self.assertTrue(subscription.last_notification.is_read, 'As forum is not reachable, notification is read') -overriden_zds_app = deepcopy(settings.ZDS_APP) -overriden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') -overriden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') -overriden_zds_app['content']['extra_content_generation_policy'] = 'SYNC' +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') +overridden_zds_app['content']['extra_content_generation_policy'] = 'SYNC' @override_settings(MEDIA_ROOT=os.path.join(settings.BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overriden_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) @override_settings(ES_ENABLED=False) class ContentNotification(TestCase): def setUp(self): # don't build PDF to speed up the tests - overriden_zds_app['content']['build_pdf_when_published'] = False + overridden_zds_app['content']['build_pdf_when_published'] = False self.user1 = ProfileFactory().user self.user2 = ProfileFactory().user @@ -118,9 +118,9 @@ def test_no_persistant_notif_on_revoke(self): def tearDown(self): - if os.path.isdir(overriden_zds_app['content']['repo_private_path']): - shutil.rmtree(overriden_zds_app['content']['repo_private_path']) - if os.path.isdir(overriden_zds_app['content']['repo_public_path']): - shutil.rmtree(overriden_zds_app['content']['repo_public_path']) + if os.path.isdir(overridden_zds_app['content']['repo_private_path']): + shutil.rmtree(overridden_zds_app['content']['repo_private_path']) + if os.path.isdir(overridden_zds_app['content']['repo_public_path']): + shutil.rmtree(overridden_zds_app['content']['repo_public_path']) if os.path.isdir(settings.MEDIA_ROOT): shutil.rmtree(settings.MEDIA_ROOT) diff --git a/zds/searchv2/tests/tests_models.py b/zds/searchv2/tests/tests_models.py index 6b126e9610..4cc22c7316 100644 --- a/zds/searchv2/tests/tests_models.py +++ b/zds/searchv2/tests/tests_models.py @@ -19,13 +19,13 @@ from copy import deepcopy -overrided_zds_app = deepcopy(settings.ZDS_APP) -overrided_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') -overrided_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') @override_settings(MEDIA_ROOT=os.path.join(settings.BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) @override_settings(ES_SEARCH_INDEX={'name': 'zds_search_test', 'shards': 5, 'replicas': 0}) class ESIndexManagerTests(TestCase): def setUp(self): diff --git a/zds/searchv2/tests/tests_utils.py b/zds/searchv2/tests/tests_utils.py index a5303aa637..c4591a722a 100644 --- a/zds/searchv2/tests/tests_utils.py +++ b/zds/searchv2/tests/tests_utils.py @@ -19,13 +19,13 @@ from zds.searchv2.models import ESIndexManager from copy import deepcopy -overrided_zds_app = deepcopy(settings.ZDS_APP) -overrided_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') -overrided_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') @override_settings(MEDIA_ROOT=os.path.join(settings.BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) @override_settings(ES_SEARCH_INDEX={'name': 'zds_search_test', 'shards': 5, 'replicas': 0}) class UtilsTests(TestCase): def setUp(self): diff --git a/zds/searchv2/tests/tests_views.py b/zds/searchv2/tests/tests_views.py index 44785d2c73..84875c44d8 100644 --- a/zds/searchv2/tests/tests_views.py +++ b/zds/searchv2/tests/tests_views.py @@ -22,13 +22,13 @@ from zds.tutorialv2.models.models_database import PublishedContent, FakeChapter, PublishableContent from copy import deepcopy -overrided_zds_app = deepcopy(settings.ZDS_APP) -overrided_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') -overrided_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') @override_settings(MEDIA_ROOT=os.path.join(settings.BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) # 1 shard is not a recommended setting, but since document on different shards may have different scores, it is ok here @override_settings(ES_SEARCH_INDEX={'name': 'zds_search_test', 'shards': 1, 'replicas': 0}) class ViewsTests(TestCase): diff --git a/zds/settings.py b/zds/settings.py index 8c039c1fd4..366235f13a 100644 --- a/zds/settings.py +++ b/zds/settings.py @@ -620,7 +620,7 @@ USE_CAPTCHA = False NOCAPTCHA = True # Use the 'No Captcha engine' RECAPTCHA_USE_SSL = True -# keys (should be overriden in the settings_prod.py file) +# keys (should be overridden in the settings_prod.py file) RECAPTCHA_PUBLIC_KEY = 'dummy' # noqa RECAPTCHA_PRIVATE_KEY = 'dummy' # noqa diff --git a/zds/tutorialv2/api/tests.py b/zds/tutorialv2/api/tests.py index 9ed20d24be..1fb7c51f92 100644 --- a/zds/tutorialv2/api/tests.py +++ b/zds/tutorialv2/api/tests.py @@ -17,15 +17,15 @@ from zds.tutorialv2.factories import ContentReactionFactory, PublishedContentFactory from zds.utils.models import CommentVote -overrided_zds_app = deepcopy(settings.ZDS_APP) -overrided_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') -overrided_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') -overrided_zds_app['content']['extra_content_generation_policy'] = 'SYNC' -overrided_zds_app['content']['build_pdf_when_published'] = False +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') +overridden_zds_app['content']['extra_content_generation_policy'] = 'SYNC' +overridden_zds_app['content']['build_pdf_when_published'] = False @override_settings(MEDIA_ROOT=os.path.join(settings.BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) class ContentReactionKarmaAPITest(APITestCase): def setUp(self): self.client = APIClient() diff --git a/zds/tutorialv2/publication_utils.py b/zds/tutorialv2/publication_utils.py index 51f30094a7..79e821e14e 100644 --- a/zds/tutorialv2/publication_utils.py +++ b/zds/tutorialv2/publication_utils.py @@ -226,7 +226,7 @@ def get(cls, name): class Publicator: """ - Publicator base object, all methods must be overriden + Publicator base object, all methods must be overridden """ def publish(self, md_file_path, base_name, **kwargs): diff --git a/zds/tutorialv2/tests/tests_feeds.py b/zds/tutorialv2/tests/tests_feeds.py index 1a4e41f7fc..68206e317f 100644 --- a/zds/tutorialv2/tests/tests_feeds.py +++ b/zds/tutorialv2/tests/tests_feeds.py @@ -18,34 +18,34 @@ from zds.tutorialv2.publication_utils import publish_content from copy import deepcopy -overrided_zds_app = deepcopy(settings.ZDS_APP) -overrided_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') -overrided_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') @override_settings(MEDIA_ROOT=os.path.join(settings.BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) class LastTutorialsFeedRSSTest(TestCase): def setUp(self): # don't build PDF to speed up the tests - overrided_zds_app['content']['build_pdf_when_published'] = False + overridden_zds_app['content']['build_pdf_when_published'] = False self.staff = StaffProfileFactory().user settings.EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend' self.mas = ProfileFactory().user - overrided_zds_app['member']['bot_account'] = self.mas.username + overridden_zds_app['member']['bot_account'] = self.mas.username - bot = Group(name=overrided_zds_app['member']['bot_group']) + bot = Group(name=overridden_zds_app['member']['bot_group']) bot.save() self.external = UserFactory( - username=overrided_zds_app['member']['external_account'], + username=overridden_zds_app['member']['external_account'], password='anything') self.beta_forum = ForumFactory( - pk=overrided_zds_app['forum']['beta_forum_id'], + pk=overridden_zds_app['forum']['beta_forum_id'], category=CategoryFactory(position=1), position_in_category=1) # ensure that the forum, for the beta versions, is created @@ -85,9 +85,9 @@ def test_is_well_setup(self): """ Test that base parameters are Ok """ self.assertEqual(self.tutofeed.link, '/tutoriels/') - reftitle = u'Tutoriels sur {}'.format(overrided_zds_app['site']['literal_name']) + reftitle = u'Tutoriels sur {}'.format(overridden_zds_app['site']['literal_name']) self.assertEqual(self.tutofeed.title, reftitle) - refdescription = u'Les derniers tutoriels parus sur {}.'.format(overrided_zds_app['site']['literal_name']) + refdescription = u'Les derniers tutoriels parus sur {}.'.format(overridden_zds_app['site']['literal_name']) self.assertEqual(self.tutofeed.description, refdescription) atom = LastTutorialsFeedATOM() @@ -140,36 +140,36 @@ def test_get_item_link(self): self.assertEqual(ret, ref) def tearDown(self): - if os.path.isdir(overrided_zds_app['content']['repo_private_path']): - shutil.rmtree(overrided_zds_app['content']['repo_private_path']) - if os.path.isdir(overrided_zds_app['content']['repo_public_path']): - shutil.rmtree(overrided_zds_app['content']['repo_public_path']) + if os.path.isdir(overridden_zds_app['content']['repo_private_path']): + shutil.rmtree(overridden_zds_app['content']['repo_private_path']) + if os.path.isdir(overridden_zds_app['content']['repo_public_path']): + shutil.rmtree(overridden_zds_app['content']['repo_public_path']) if os.path.isdir(settings.MEDIA_ROOT): shutil.rmtree(settings.MEDIA_ROOT) -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) class LastArticlesFeedRSSTest(TestCase): def setUp(self): # don't build PDF to speed up the tests - overrided_zds_app['content']['build_pdf_when_published'] = False + overridden_zds_app['content']['build_pdf_when_published'] = False self.staff = StaffProfileFactory().user settings.EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend' self.mas = ProfileFactory().user - overrided_zds_app['member']['bot_account'] = self.mas.username + overridden_zds_app['member']['bot_account'] = self.mas.username - bot = Group(name=overrided_zds_app['member']['bot_group']) + bot = Group(name=overridden_zds_app['member']['bot_group']) bot.save() self.external = UserFactory( - username=overrided_zds_app['member']['external_account'], + username=overridden_zds_app['member']['external_account'], password='anything') self.beta_forum = ForumFactory( - pk=overrided_zds_app['forum']['beta_forum_id'], + pk=overridden_zds_app['forum']['beta_forum_id'], category=CategoryFactory(position=1), position_in_category=1) # ensure that the forum, for the beta versions, is created @@ -207,9 +207,9 @@ def test_is_well_setup(self): """ Test that base parameters are Ok """ self.assertEqual(self.articlefeed.link, '/articles/') - reftitle = u'Articles sur {}'.format(overrided_zds_app['site']['literal_name']) + reftitle = u'Articles sur {}'.format(overridden_zds_app['site']['literal_name']) self.assertEqual(self.articlefeed.title, reftitle) - refdescription = u'Les derniers articles parus sur {}.'.format(overrided_zds_app['site']['literal_name']) + refdescription = u'Les derniers articles parus sur {}.'.format(overridden_zds_app['site']['literal_name']) self.assertEqual(self.articlefeed.description, refdescription) atom = LastArticlesFeedATOM() @@ -262,9 +262,9 @@ def test_get_item_link(self): self.assertEqual(ret, ref) def tearDown(self): - if os.path.isdir(overrided_zds_app['content']['repo_private_path']): - shutil.rmtree(overrided_zds_app['content']['repo_private_path']) - if os.path.isdir(overrided_zds_app['content']['repo_public_path']): - shutil.rmtree(overrided_zds_app['content']['repo_public_path']) + if os.path.isdir(overridden_zds_app['content']['repo_private_path']): + shutil.rmtree(overridden_zds_app['content']['repo_private_path']) + if os.path.isdir(overridden_zds_app['content']['repo_public_path']): + shutil.rmtree(overridden_zds_app['content']['repo_public_path']) if os.path.isdir(settings.MEDIA_ROOT): shutil.rmtree(settings.MEDIA_ROOT) diff --git a/zds/tutorialv2/tests/tests_lists.py b/zds/tutorialv2/tests/tests_lists.py index 5d49ee1ece..55acc5ed57 100644 --- a/zds/tutorialv2/tests/tests_lists.py +++ b/zds/tutorialv2/tests/tests_lists.py @@ -16,25 +16,25 @@ from zds.forum.factories import ForumFactory, CategoryFactory from copy import deepcopy -overrided_zds_app = deepcopy(settings.ZDS_APP) -overrided_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') -overrided_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') @override_settings(MEDIA_ROOT=os.path.join(settings.BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) @override_settings(ES_ENABLED=False) class ContentTests(TestCase): def setUp(self): # don't build PDF to speed up the tests - overrided_zds_app['content']['build_pdf_when_published'] = False + overridden_zds_app['content']['build_pdf_when_published'] = False self.staff = StaffProfileFactory().user settings.EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend' self.mas = ProfileFactory().user - overrided_zds_app['member']['bot_account'] = self.mas.username + overridden_zds_app['member']['bot_account'] = self.mas.username self.licence = LicenceFactory() self.subcategory = SubCategoryFactory() @@ -51,7 +51,7 @@ def setUp(self): self.tuto.save() self.beta_forum = ForumFactory( - pk=overrided_zds_app['forum']['beta_forum_id'], + pk=overridden_zds_app['forum']['beta_forum_id'], category=CategoryFactory(position=1), position_in_category=1) # ensure that the forum, for the beta versions, is created @@ -60,10 +60,10 @@ def setUp(self): self.chapter1 = ContainerFactory(parent=self.part1, db_object=self.tuto) self.extract1 = ExtractFactory(container=self.chapter1, db_object=self.tuto) - bot = Group(name=overrided_zds_app['member']['bot_group']) + bot = Group(name=overridden_zds_app['member']['bot_group']) bot.save() self.external = UserFactory( - username=overrided_zds_app['member']['external_account'], + username=overridden_zds_app['member']['external_account'], password='anything') def test_public_lists(self): @@ -205,9 +205,9 @@ def test_validation_list(self): def tearDown(self): - if os.path.isdir(overrided_zds_app['content']['repo_private_path']): - shutil.rmtree(overrided_zds_app['content']['repo_private_path']) - if os.path.isdir(overrided_zds_app['content']['repo_public_path']): - shutil.rmtree(overrided_zds_app['content']['repo_public_path']) + if os.path.isdir(overridden_zds_app['content']['repo_private_path']): + shutil.rmtree(overridden_zds_app['content']['repo_private_path']) + if os.path.isdir(overridden_zds_app['content']['repo_public_path']): + shutil.rmtree(overridden_zds_app['content']['repo_public_path']) if os.path.isdir(settings.MEDIA_ROOT): shutil.rmtree(settings.MEDIA_ROOT) diff --git a/zds/tutorialv2/tests/tests_models.py b/zds/tutorialv2/tests/tests_models.py index 439a9cf6ae..133c364fc4 100644 --- a/zds/tutorialv2/tests/tests_models.py +++ b/zds/tutorialv2/tests/tests_models.py @@ -22,24 +22,24 @@ from django.template.defaultfilters import date from copy import deepcopy -overrided_zds_app = deepcopy(settings.ZDS_APP) -overrided_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') -overrided_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') @override_settings(MEDIA_ROOT=os.path.join(settings.BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) @override_settings(ES_ENABLED=False) class ContentTests(TestCase): def setUp(self): # don't build PDF to speed up the tests - overrided_zds_app['content']['build_pdf_when_published'] = False + overridden_zds_app['content']['build_pdf_when_published'] = False settings.EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend' self.mas = ProfileFactory().user - overrided_zds_app['member']['bot_account'] = self.mas.username + overridden_zds_app['member']['bot_account'] = self.mas.username self.licence = LicenceFactory() @@ -571,9 +571,9 @@ def test_ensure_gallery(self): self.assertEqual(UserGallery.objects.filter(gallery__pk=content.gallery.pk).count(), content.authors.count()) def tearDown(self): - if os.path.isdir(overrided_zds_app['content']['repo_private_path']): - shutil.rmtree(overrided_zds_app['content']['repo_private_path']) - if os.path.isdir(overrided_zds_app['content']['repo_public_path']): - shutil.rmtree(overrided_zds_app['content']['repo_public_path']) + if os.path.isdir(overridden_zds_app['content']['repo_private_path']): + shutil.rmtree(overridden_zds_app['content']['repo_private_path']) + if os.path.isdir(overridden_zds_app['content']['repo_public_path']): + shutil.rmtree(overridden_zds_app['content']['repo_public_path']) if os.path.isdir(settings.MEDIA_ROOT): shutil.rmtree(settings.MEDIA_ROOT) diff --git a/zds/tutorialv2/tests/tests_move.py b/zds/tutorialv2/tests/tests_move.py index 70c86ee004..3f55840436 100644 --- a/zds/tutorialv2/tests/tests_move.py +++ b/zds/tutorialv2/tests/tests_move.py @@ -18,26 +18,26 @@ from zds.tutorialv2.publication_utils import publish_content from copy import deepcopy -overrided_zds_app = deepcopy(settings.ZDS_APP) -overrided_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') -overrided_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') @override_settings(MEDIA_ROOT=os.path.join(settings.BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) @override_settings(ES_ENABLED=False) class ContentMoveTests(TestCase): def setUp(self): # don't build PDF to speed up the tests - overrided_zds_app['content']['build_pdf_when_published'] = False + overridden_zds_app['content']['build_pdf_when_published'] = False self.staff = StaffProfileFactory().user settings.EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend' self.mas = ProfileFactory().user - overrided_zds_app['member']['bot_account'] = self.mas.username + overridden_zds_app['member']['bot_account'] = self.mas.username self.licence = LicenceFactory() self.subcategory = SubCategoryFactory() @@ -54,7 +54,7 @@ def setUp(self): self.tuto.save() self.beta_forum = ForumFactory( - pk=overrided_zds_app['forum']['beta_forum_id'], + pk=overridden_zds_app['forum']['beta_forum_id'], category=CategoryFactory(position=1), position_in_category=1) # ensure that the forum, for the beta versions, is created @@ -63,7 +63,7 @@ def setUp(self): self.chapter1 = ContainerFactory(parent=self.part1, db_object=self.tuto) self.extract1 = ExtractFactory(container=self.chapter1, db_object=self.tuto) - bot = Group(name=overrided_zds_app['member']['bot_group']) + bot = Group(name=overridden_zds_app['member']['bot_group']) bot.save() def test_move_up_extract(self): @@ -561,9 +561,9 @@ def test_move_no_slug_update(self): self.assertTrue(isdir(tuto.get_repo_path())) def tearDown(self): - if os.path.isdir(overrided_zds_app['content']['repo_private_path']): - shutil.rmtree(overrided_zds_app['content']['repo_private_path']) - if os.path.isdir(overrided_zds_app['content']['repo_public_path']): - shutil.rmtree(overrided_zds_app['content']['repo_public_path']) + if os.path.isdir(overridden_zds_app['content']['repo_private_path']): + shutil.rmtree(overridden_zds_app['content']['repo_private_path']) + if os.path.isdir(overridden_zds_app['content']['repo_public_path']): + shutil.rmtree(overridden_zds_app['content']['repo_public_path']) if os.path.isdir(settings.MEDIA_ROOT): shutil.rmtree(settings.MEDIA_ROOT) diff --git a/zds/tutorialv2/tests/tests_opinion_views.py b/zds/tutorialv2/tests/tests_opinion_views.py index 534d4bcb7a..de36c689bd 100644 --- a/zds/tutorialv2/tests/tests_opinion_views.py +++ b/zds/tutorialv2/tests/tests_opinion_views.py @@ -16,20 +16,20 @@ from zds.utils.models import Alert from copy import deepcopy -overrided_zds_app = deepcopy(settings.ZDS_APP) -overrided_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') -overrided_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') -overrided_zds_app['content']['extra_content_generation_policy'] = 'NONE' +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') +overridden_zds_app['content']['extra_content_generation_policy'] = 'NONE' @override_settings(MEDIA_ROOT=os.path.join(settings.BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) @override_settings(ES_ENABLED=False) class PublishedContentTests(TestCase): def setUp(self): - overrided_zds_app['member']['bot_account'] = ProfileFactory().user.username + overridden_zds_app['member']['bot_account'] = ProfileFactory().user.username self.licence = LicenceFactory() - overrided_zds_app['content']['default_licence_pk'] = LicenceFactory().pk + overridden_zds_app['content']['default_licence_pk'] = LicenceFactory().pk self.user_author = ProfileFactory().user self.user_staff = StaffProfileFactory().user self.user_guest = ProfileFactory().user @@ -947,9 +947,9 @@ def test_opinion_alert(self): def tearDown(self): - if os.path.isdir(overrided_zds_app['content']['repo_private_path']): - shutil.rmtree(overrided_zds_app['content']['repo_private_path']) - if os.path.isdir(overrided_zds_app['content']['repo_public_path']): - shutil.rmtree(overrided_zds_app['content']['repo_public_path']) + if os.path.isdir(overridden_zds_app['content']['repo_private_path']): + shutil.rmtree(overridden_zds_app['content']['repo_private_path']) + if os.path.isdir(overridden_zds_app['content']['repo_public_path']): + shutil.rmtree(overridden_zds_app['content']['repo_public_path']) if os.path.isdir(settings.MEDIA_ROOT): shutil.rmtree(settings.MEDIA_ROOT) diff --git a/zds/tutorialv2/tests/tests_utils.py b/zds/tutorialv2/tests/tests_utils.py index ab90fbe543..9d780d72ec 100644 --- a/zds/tutorialv2/tests/tests_utils.py +++ b/zds/tutorialv2/tests/tests_utils.py @@ -36,24 +36,24 @@ BASE_DIR = settings.BASE_DIR -overrided_zds_app = deepcopy(settings.ZDS_APP) -overrided_zds_app['content']['repo_private_path'] = os.path.join(BASE_DIR, 'contents-private-test') -overrided_zds_app['content']['repo_public_path'] = os.path.join(BASE_DIR, 'contents-public-test') -overrided_zds_app['tutorial']['repo_path'] = os.path.join(BASE_DIR, 'tutoriels-private-test') -overrided_zds_app['tutorial']['repo_public_path'] = os.path.join(BASE_DIR, 'tutoriels-public-test') -overrided_zds_app['article']['repo_path'] = os.path.join(BASE_DIR, 'article-data-test') -overrided_zds_app['content']['build_pdf_when_published'] = False +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(BASE_DIR, 'contents-public-test') +overridden_zds_app['tutorial']['repo_path'] = os.path.join(BASE_DIR, 'tutoriels-private-test') +overridden_zds_app['tutorial']['repo_public_path'] = os.path.join(BASE_DIR, 'tutoriels-public-test') +overridden_zds_app['article']['repo_path'] = os.path.join(BASE_DIR, 'article-data-test') +overridden_zds_app['content']['build_pdf_when_published'] = False @override_settings(MEDIA_ROOT=os.path.join(BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) @override_settings(ES_ENABLED=False) @override_settings(EMAIL_BACKEND='django.core.mail.backends.locmem.EmailBackend') class UtilsTests(TestCase): def setUp(self): self.mas = ProfileFactory().user - overrided_zds_app['member']['bot_account'] = self.mas.username + overridden_zds_app['member']['bot_account'] = self.mas.username self.licence = LicenceFactory() @@ -380,7 +380,7 @@ def test_retrieve_images(self): def test_generate_pdf(self): """ensure the behavior of the `python manage.py generate_pdf` commmand""" - overrided_zds_app['content']['build_pdf_when_published'] = True # this test need PDF build, if any + overridden_zds_app['content']['build_pdf_when_published'] = True # this test need PDF build, if any tuto = PublishedContentFactory(type='TUTORIAL') # generate and publish a tutorial published = PublishedContent.objects.get(content_pk=tuto.pk) @@ -538,7 +538,7 @@ def invalid_slug_is_invalid(self): self.assertFalse(check_slug(s)) # too long slugs are forbidden : - too_damn_long_slug = 'a' * (overrided_zds_app['content']['maximum_slug_size'] + 1) + too_damn_long_slug = 'a' * (overridden_zds_app['content']['maximum_slug_size'] + 1) self.assertFalse(check_slug(too_damn_long_slug)) def test_watchdog(self): @@ -581,12 +581,12 @@ def test_adjust_char_count(self): self.assertEqual(published.char_count, published.get_char_count()) def tearDown(self): - if os.path.isdir(overrided_zds_app['content']['repo_private_path']): - shutil.rmtree(overrided_zds_app['content']['repo_private_path']) - if os.path.isdir(overrided_zds_app['content']['repo_public_path']): - shutil.rmtree(overrided_zds_app['content']['repo_public_path']) + if os.path.isdir(overridden_zds_app['content']['repo_private_path']): + shutil.rmtree(overridden_zds_app['content']['repo_private_path']) + if os.path.isdir(overridden_zds_app['content']['repo_public_path']): + shutil.rmtree(overridden_zds_app['content']['repo_public_path']) if os.path.isdir(settings.MEDIA_ROOT): shutil.rmtree(settings.MEDIA_ROOT) - if os.path.isdir(overrided_zds_app['content']['extra_content_watchdog_dir']): - shutil.rmtree(overrided_zds_app['content']['extra_content_watchdog_dir']) + if os.path.isdir(overridden_zds_app['content']['extra_content_watchdog_dir']): + shutil.rmtree(overridden_zds_app['content']['extra_content_watchdog_dir']) PublicatorRegistery.registry = self.old_registry diff --git a/zds/tutorialv2/tests/tests_views.py b/zds/tutorialv2/tests/tests_views.py index ed93d4fa4d..1cb0373ce5 100644 --- a/zds/tutorialv2/tests/tests_views.py +++ b/zds/tutorialv2/tests/tests_views.py @@ -46,10 +46,10 @@ import json as json_reader -overriden_zds_app = deepcopy(settings.ZDS_APP) -overriden_zds_app['content']['repo_private_path'] = os.path.join(BASE_DIR, 'contents-private-test') -overriden_zds_app['content']['repo_public_path'] = os.path.join(BASE_DIR, 'contents-public-test') -overriden_zds_app['content']['extra_content_generation_policy'] = 'SYNC' +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(BASE_DIR, 'contents-public-test') +overridden_zds_app['content']['extra_content_generation_policy'] = 'SYNC' @PublicatorRegistery.register('pdf') @@ -60,20 +60,20 @@ def publish(self, md_file_path, base_name, **kwargs): @override_settings(MEDIA_ROOT=os.path.join(BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overriden_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) @override_settings(ES_ENABLED=False) class ContentTests(TestCase): def setUp(self): - overriden_zds_app['content']['default_licence_pk'] = LicenceFactory().pk + overridden_zds_app['content']['default_licence_pk'] = LicenceFactory().pk # don't build PDF to speed up the tests - overriden_zds_app['content']['build_pdf_when_published'] = False + overridden_zds_app['content']['build_pdf_when_published'] = False self.staff = StaffProfileFactory().user settings.EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend' self.mas = ProfileFactory().user - overriden_zds_app['member']['bot_account'] = self.mas.username + overridden_zds_app['member']['bot_account'] = self.mas.username self.licence = LicenceFactory() self.subcategory = SubCategoryFactory() @@ -90,7 +90,7 @@ def setUp(self): self.tuto.save() self.beta_forum = ForumFactory( - pk=overriden_zds_app['forum']['beta_forum_id'], + pk=overridden_zds_app['forum']['beta_forum_id'], category=CategoryFactory(position=1), position_in_category=1) # ensure that the forum, for the beta versions, is created @@ -99,10 +99,10 @@ def setUp(self): self.chapter1 = ContainerFactory(parent=self.part1, db_object=self.tuto) self.extract1 = ExtractFactory(container=self.chapter1, db_object=self.tuto) - bot = Group(name=overriden_zds_app['member']['bot_group']) + bot = Group(name=overridden_zds_app['member']['bot_group']) bot.save() self.external = UserFactory( - username=overriden_zds_app['member']['external_account'], + username=overridden_zds_app['member']['external_account'], password='anything') def test_ensure_access(self): @@ -1785,7 +1785,7 @@ def import_with_bad_title(self): def test_import_image_with_archive(self): """ensure that import archive work, and link are changed""" - prefix = overriden_zds_app['content']['import_image_prefix'] + prefix = overridden_zds_app['content']['import_image_prefix'] title = u'OSEF ici du titre :p' text1 = u'![]({}:image1.png) ![]({}:dossier/image2.png)'.format(prefix, prefix) text2 = u'![Piège](img3.png) ![Image qui existe pas]({}:img3.png) ![](mauvais:img3.png)'.format(prefix) @@ -1861,7 +1861,7 @@ def test_import_image_with_archive(self): # check links: text = versioned.children[0].get_text() for img in Image.objects.filter(gallery=new_article.gallery).all(): - self.assertTrue('![]({})'.format(overriden_zds_app['site']['secure_url'] + img.physical.url) in text) + self.assertTrue('![]({})'.format(overridden_zds_app['site']['secure_url'] + img.physical.url) in text) # import into first article (that will only change the images) result = self.client.post( @@ -1888,7 +1888,7 @@ def test_import_image_with_archive(self): # check links: text = versioned.children[0].get_text() for img in Image.objects.filter(gallery=new_version.gallery).all(): - self.assertTrue('![]({})'.format(overriden_zds_app['site']['secure_url'] + img.physical.url) in text) + self.assertTrue('![]({})'.format(overridden_zds_app['site']['secure_url'] + img.physical.url) in text) # clean up os.remove(draft_zip_path) @@ -3642,7 +3642,7 @@ def test_publication_make_extra_contents(self): NOTE: this test will take time !""" - overriden_zds_app['content']['build_pdf_when_published'] = True # obviously, PDF builds have to be enabled + overridden_zds_app['content']['build_pdf_when_published'] = True # obviously, PDF builds have to be enabled title = u"C'est pas le plus important ici !" @@ -4093,37 +4093,37 @@ def test_no_invalid_titles(self): def tearDown(self): - if os.path.isdir(overriden_zds_app['content']['repo_private_path']): - shutil.rmtree(overriden_zds_app['content']['repo_private_path']) - if os.path.isdir(overriden_zds_app['content']['repo_public_path']): - shutil.rmtree(overriden_zds_app['content']['repo_public_path']) + if os.path.isdir(overridden_zds_app['content']['repo_private_path']): + shutil.rmtree(overridden_zds_app['content']['repo_private_path']) + if os.path.isdir(overridden_zds_app['content']['repo_public_path']): + shutil.rmtree(overridden_zds_app['content']['repo_public_path']) if os.path.isdir(settings.MEDIA_ROOT): shutil.rmtree(settings.MEDIA_ROOT) @override_settings(MEDIA_ROOT=os.path.join(BASE_DIR, 'media-test')) -@override_settings(ZDS_APP=overriden_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) @override_settings(ES_ENABLED=False) class PublishedContentTests(TestCase): def setUp(self): - overriden_zds_app['content']['default_licence_pk'] = LicenceFactory().pk + overridden_zds_app['content']['default_licence_pk'] = LicenceFactory().pk # don't build PDF to speed up the tests - overriden_zds_app['content']['build_pdf_when_published'] = False + overridden_zds_app['content']['build_pdf_when_published'] = False self.staff = StaffProfileFactory().user settings.EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend' self.mas = ProfileFactory().user - overriden_zds_app['member']['bot_account'] = self.mas.username + overridden_zds_app['member']['bot_account'] = self.mas.username - bot = Group(name=overriden_zds_app['member']['bot_group']) + bot = Group(name=overridden_zds_app['member']['bot_group']) bot.save() self.external = UserFactory( - username=overriden_zds_app['member']['external_account'], + username=overridden_zds_app['member']['external_account'], password='anything') self.beta_forum = ForumFactory( - pk=overriden_zds_app['forum']['beta_forum_id'], + pk=overridden_zds_app['forum']['beta_forum_id'], category=CategoryFactory(position=1), position_in_category=1) # ensure that the forum, for the beta versions, is created @@ -4161,10 +4161,10 @@ def setUp(self): self.tuto.save() def tearDown(self): - if os.path.isdir(overriden_zds_app['content']['repo_private_path']): - shutil.rmtree(overriden_zds_app['content']['repo_private_path']) - if os.path.isdir(overriden_zds_app['content']['repo_public_path']): - shutil.rmtree(overriden_zds_app['content']['repo_public_path']) + if os.path.isdir(overridden_zds_app['content']['repo_private_path']): + shutil.rmtree(overridden_zds_app['content']['repo_private_path']) + if os.path.isdir(overridden_zds_app['content']['repo_public_path']): + shutil.rmtree(overridden_zds_app['content']['repo_public_path']) if os.path.isdir(settings.MEDIA_ROOT): shutil.rmtree(settings.MEDIA_ROOT) diff --git a/zds/utils/templatetags/tests/test_top_tags.py b/zds/utils/templatetags/tests/test_top_tags.py index 014758855e..c7d5f62059 100644 --- a/zds/utils/templatetags/tests/test_top_tags.py +++ b/zds/utils/templatetags/tests/test_top_tags.py @@ -14,13 +14,13 @@ from zds.utils.templatetags.topbar import top_categories, top_categories_content from copy import deepcopy -overrided_zds_app = deepcopy(settings.ZDS_APP) -overrided_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') -overrided_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') -overrided_zds_app['content']['build_pdf_when_published'] = False +overridden_zds_app = deepcopy(settings.ZDS_APP) +overridden_zds_app['content']['repo_private_path'] = os.path.join(settings.BASE_DIR, 'contents-private-test') +overridden_zds_app['content']['repo_public_path'] = os.path.join(settings.BASE_DIR, 'contents-public-test') +overridden_zds_app['content']['build_pdf_when_published'] = False -@override_settings(ZDS_APP=overrided_zds_app) +@override_settings(ZDS_APP=overridden_zds_app) class TopBarTests(TestCase): def setUp(self): @@ -96,7 +96,7 @@ def test_top_tags(self): self.assertEqual(len(top_tags), 4) # Now we want to exclude a tag - overrided_zds_app['forum']['top_tag_exclu'] = {'tag-4-4'} + overridden_zds_app['forum']['top_tag_exclu'] = {'tag-4-4'} # User only sees the only 'public' tag left top_tags = top_categories(user).get('tags') @@ -127,9 +127,9 @@ def test_top_tags_content(self): def tearDown(self): - if os.path.isdir(overrided_zds_app['content']['repo_private_path']): - shutil.rmtree(overrided_zds_app['content']['repo_private_path']) - if os.path.isdir(overrided_zds_app['content']['repo_public_path']): - shutil.rmtree(overrided_zds_app['content']['repo_public_path']) + if os.path.isdir(overridden_zds_app['content']['repo_private_path']): + shutil.rmtree(overridden_zds_app['content']['repo_private_path']) + if os.path.isdir(overridden_zds_app['content']['repo_public_path']): + shutil.rmtree(overridden_zds_app['content']['repo_public_path']) if os.path.isdir(settings.MEDIA_ROOT): shutil.rmtree(settings.MEDIA_ROOT)