From 7d269a9df0eb352fc0089fc12218630765165e17 Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Fri, 8 Nov 2019 08:15:14 +0100 Subject: [PATCH] Reorganize test files structure --- colleges/{tests.py => tests/test_models.py} | 0 commentaries/{ => tests}/test_forms.py | 6 +++--- commentaries/{ => tests}/test_models.py | 2 +- commentaries/{ => tests}/test_views.py | 8 ++++---- comments/{ => tests}/test_views.py | 0 forums/tests.py | 3 --- comments/tests.py => funders/tests/test_models.py | 0 helpdesk/tests.py | 3 --- funders/tests.py => invitations/tests/test_models.py | 0 invitations/tests.py => journals/tests/test_models.py | 0 markup/tests.py | 3 --- journals/tests.py => news/tests/test_models.py | 0 organizations/tests.py | 3 --- news/tests.py => preprints/tests/test_models.py | 0 proceedings/tests.py | 7 ------- petitions/tests.py => proceedings/tests/test_models.py | 0 production/tests.py | 7 ------- preprints/tests.py => production/tests/test_models.py | 0 profiles/tests.py | 7 ------- scipost/{ => tests}/test_services.py | 2 +- scipost/tests/test_totp.py | 4 ++++ scipost/{ => tests}/test_views.py | 2 +- stats/tests.py | 7 ------- submissions/{ => tests}/test_models.py | 0 submissions/{ => tests}/test_utils.py | 6 +++--- submissions/{ => tests}/test_views.py | 8 ++++---- theses/{ => tests}/test_forms.py | 4 ++-- theses/{ => tests}/test_models.py | 4 ++-- theses/{ => tests}/test_views.py | 8 ++++---- 29 files changed, 29 insertions(+), 65 deletions(-) rename colleges/{tests.py => tests/test_models.py} (100%) rename commentaries/{ => tests}/test_forms.py (97%) rename commentaries/{ => tests}/test_models.py (86%) rename commentaries/{ => tests}/test_views.py (96%) rename comments/{ => tests}/test_views.py (100%) delete mode 100644 forums/tests.py rename comments/tests.py => funders/tests/test_models.py (100%) delete mode 100644 helpdesk/tests.py rename funders/tests.py => invitations/tests/test_models.py (100%) rename invitations/tests.py => journals/tests/test_models.py (100%) delete mode 100644 markup/tests.py rename journals/tests.py => news/tests/test_models.py (100%) delete mode 100644 organizations/tests.py rename news/tests.py => preprints/tests/test_models.py (100%) delete mode 100644 proceedings/tests.py rename petitions/tests.py => proceedings/tests/test_models.py (100%) delete mode 100644 production/tests.py rename preprints/tests.py => production/tests/test_models.py (100%) delete mode 100644 profiles/tests.py rename scipost/{ => tests}/test_services.py (99%) rename scipost/{ => tests}/test_views.py (99%) delete mode 100644 stats/tests.py rename submissions/{ => tests}/test_models.py (100%) rename submissions/{ => tests}/test_utils.py (98%) rename submissions/{ => tests}/test_views.py (98%) rename theses/{ => tests}/test_forms.py (92%) rename theses/{ => tests}/test_models.py (82%) rename theses/{ => tests}/test_views.py (97%) diff --git a/colleges/tests.py b/colleges/tests/test_models.py similarity index 100% rename from colleges/tests.py rename to colleges/tests/test_models.py diff --git a/commentaries/test_forms.py b/commentaries/tests/test_forms.py similarity index 97% rename from commentaries/test_forms.py rename to commentaries/tests/test_forms.py index 1d1015d5b..9b3a49668 100644 --- a/commentaries/test_forms.py +++ b/commentaries/tests/test_forms.py @@ -9,11 +9,11 @@ from django.test import TestCase from common.helpers import model_form_data from scipost.factories import UserFactory, ContributorFactory -from .factories import CommentaryFactory, UnvettedCommentaryFactory,\ +from ..factories import CommentaryFactory, UnvettedCommentaryFactory,\ UnvettedUnpublishedCommentaryFactory -from .forms import RequestPublishedArticleForm, VetCommentaryForm, DOIToQueryForm,\ +from ..forms import RequestPublishedArticleForm, VetCommentaryForm, DOIToQueryForm,\ ArxivQueryForm, RequestArxivPreprintForm -from .models import Commentary +from ..models import Commentary from common.helpers.test import add_groups_and_permissions diff --git a/commentaries/test_models.py b/commentaries/tests/test_models.py similarity index 86% rename from commentaries/test_models.py rename to commentaries/tests/test_models.py index f56586f8b..da9859bcf 100644 --- a/commentaries/test_models.py +++ b/commentaries/tests/test_models.py @@ -7,7 +7,7 @@ from django.test import TestCase from common.helpers.test import add_groups_and_permissions from scipost.factories import ContributorFactory -from .factories import UnvettedCommentaryFactory +from ..factories import UnvettedCommentaryFactory class TestCommentary(TestCase): diff --git a/commentaries/test_views.py b/commentaries/tests/test_views.py similarity index 96% rename from commentaries/test_views.py rename to commentaries/tests/test_views.py index dc292c74b..b492232e4 100644 --- a/commentaries/test_views.py +++ b/commentaries/tests/test_views.py @@ -9,11 +9,11 @@ from django.test import TestCase, Client, RequestFactory from scipost.models import Contributor from scipost.factories import ContributorFactory, UserFactory -from .factories import UnvettedCommentaryFactory, CommentaryFactory, UnpublishedCommentaryFactory, \ +from ..factories import UnvettedCommentaryFactory, CommentaryFactory, UnpublishedCommentaryFactory, \ UnvettedUnpublishedCommentaryFactory -from .forms import CommentarySearchForm, RequestPublishedArticleForm -from .models import Commentary -from .views import RequestPublishedArticle, prefill_using_DOI, RequestArxivPreprint +from ..forms import CommentarySearchForm, RequestPublishedArticleForm +from ..models import Commentary +from ..views import RequestPublishedArticle, prefill_using_DOI, RequestArxivPreprint from common.helpers.test import add_groups_and_permissions from common.helpers import model_form_data diff --git a/comments/test_views.py b/comments/tests/test_views.py similarity index 100% rename from comments/test_views.py rename to comments/tests/test_views.py diff --git a/forums/tests.py b/forums/tests.py deleted file mode 100644 index 7ce503c2d..000000000 --- a/forums/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/comments/tests.py b/funders/tests/test_models.py similarity index 100% rename from comments/tests.py rename to funders/tests/test_models.py diff --git a/helpdesk/tests.py b/helpdesk/tests.py deleted file mode 100644 index 7ce503c2d..000000000 --- a/helpdesk/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/funders/tests.py b/invitations/tests/test_models.py similarity index 100% rename from funders/tests.py rename to invitations/tests/test_models.py diff --git a/invitations/tests.py b/journals/tests/test_models.py similarity index 100% rename from invitations/tests.py rename to journals/tests/test_models.py diff --git a/markup/tests.py b/markup/tests.py deleted file mode 100644 index 7ce503c2d..000000000 --- a/markup/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/journals/tests.py b/news/tests/test_models.py similarity index 100% rename from journals/tests.py rename to news/tests/test_models.py diff --git a/organizations/tests.py b/organizations/tests.py deleted file mode 100644 index 7ce503c2d..000000000 --- a/organizations/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/news/tests.py b/preprints/tests/test_models.py similarity index 100% rename from news/tests.py rename to preprints/tests/test_models.py diff --git a/proceedings/tests.py b/proceedings/tests.py deleted file mode 100644 index ddef03c4d..000000000 --- a/proceedings/tests.py +++ /dev/null @@ -1,7 +0,0 @@ -__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" -__license__ = "AGPL v3" - - -from django.test import TestCase - -# Create your tests here. diff --git a/petitions/tests.py b/proceedings/tests/test_models.py similarity index 100% rename from petitions/tests.py rename to proceedings/tests/test_models.py diff --git a/production/tests.py b/production/tests.py deleted file mode 100644 index ddef03c4d..000000000 --- a/production/tests.py +++ /dev/null @@ -1,7 +0,0 @@ -__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" -__license__ = "AGPL v3" - - -from django.test import TestCase - -# Create your tests here. diff --git a/preprints/tests.py b/production/tests/test_models.py similarity index 100% rename from preprints/tests.py rename to production/tests/test_models.py diff --git a/profiles/tests.py b/profiles/tests.py deleted file mode 100644 index ddef03c4d..000000000 --- a/profiles/tests.py +++ /dev/null @@ -1,7 +0,0 @@ -__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" -__license__ = "AGPL v3" - - -from django.test import TestCase - -# Create your tests here. diff --git a/scipost/test_services.py b/scipost/tests/test_services.py similarity index 99% rename from scipost/test_services.py rename to scipost/tests/test_services.py index 44566cb63..e80dce2fc 100644 --- a/scipost/test_services.py +++ b/scipost/tests/test_services.py @@ -6,7 +6,7 @@ import datetime from django.test import TestCase -from .services import ArxivCaller, DOICaller +from ..services import ArxivCaller, DOICaller from submissions.models import Submission diff --git a/scipost/tests/test_totp.py b/scipost/tests/test_totp.py index f605ff84e..5b688e47d 100644 --- a/scipost/tests/test_totp.py +++ b/scipost/tests/test_totp.py @@ -1,3 +1,7 @@ +__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" +__license__ = "AGPL v3" + + import datetime from django.urls import reverse diff --git a/scipost/test_views.py b/scipost/tests/test_views.py similarity index 99% rename from scipost/test_views.py rename to scipost/tests/test_views.py index 6c7a74b16..017d6bfb5 100644 --- a/scipost/test_views.py +++ b/scipost/tests/test_views.py @@ -13,7 +13,7 @@ from commentaries.factories import UnvettedCommentaryFactory, CommentaryFactory, from commentaries.forms import CommentarySearchForm from commentaries.models import Commentary -from .factories import ContributorFactory +from ..factories import ContributorFactory class RequestCommentaryTest(TestCase): diff --git a/stats/tests.py b/stats/tests.py deleted file mode 100644 index ddef03c4d..000000000 --- a/stats/tests.py +++ /dev/null @@ -1,7 +0,0 @@ -__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" -__license__ = "AGPL v3" - - -from django.test import TestCase - -# Create your tests here. diff --git a/submissions/test_models.py b/submissions/tests/test_models.py similarity index 100% rename from submissions/test_models.py rename to submissions/tests/test_models.py diff --git a/submissions/test_utils.py b/submissions/tests/test_utils.py similarity index 98% rename from submissions/test_utils.py rename to submissions/tests/test_utils.py index 6acb1eb7a..ed12c52b1 100644 --- a/submissions/test_utils.py +++ b/submissions/tests/test_utils.py @@ -10,10 +10,10 @@ from common.helpers.test import add_groups_and_permissions from scipost.factories import ContributorFactory from scipost.models import Contributor -from .constants import ( +from ..constants import ( STATUS_UNASSIGNED, STATUS_INCOMING, STATUS_EIC_ASSIGNED, CYCLE_DEFAULT, CYCLE_DIRECT_REC) -from .exceptions import CycleUpdateDeadlineError -from .factories import UnassignedSubmissionFactory, ResubmissionFactory +from ..exceptions import CycleUpdateDeadlineError +from ..factories import UnassignedSubmissionFactory, ResubmissionFactory #from .utils import GeneralSubmissionCycle diff --git a/submissions/test_views.py b/submissions/tests/test_views.py similarity index 98% rename from submissions/test_views.py rename to submissions/tests/test_views.py index 8d779407c..7e379cf28 100644 --- a/submissions/test_views.py +++ b/submissions/tests/test_views.py @@ -10,13 +10,13 @@ from common.helpers import random_arxiv_identifier_without_version_number from common.helpers.test import add_groups_and_permissions from scipost.factories import ContributorFactory -from .constants import STATUS_UNASSIGNED, STATUS_DRAFT, STATUS_UNVETTED -from .factories import UnassignedSubmissionFactory, EICassignedSubmissionFactory,\ +from ..constants import STATUS_UNASSIGNED, STATUS_DRAFT, STATUS_UNVETTED +from ..factories import UnassignedSubmissionFactory, EICassignedSubmissionFactory,\ ResubmittedSubmissionFactory, ResubmissionFactory,\ PublishedSubmissionFactory, DraftReportFactory,\ AcceptedRefereeInvitationFactory -from .forms import SubmissionIdentifierForm, ReportForm, SubmissionForm -from .models import Submission, Report, RefereeInvitation +from ..forms import SubmissionIdentifierForm, ReportForm, SubmissionForm +from ..models import Submission, Report, RefereeInvitation from journals.models import Journal diff --git a/theses/test_forms.py b/theses/tests/test_forms.py similarity index 92% rename from theses/test_forms.py rename to theses/tests/test_forms.py index 1562414ea..96ef6a3e1 100644 --- a/theses/test_forms.py +++ b/theses/tests/test_forms.py @@ -7,8 +7,8 @@ import factory from django.test import TestCase, RequestFactory from scipost.factories import ContributorFactory -from .factories import ThesisLinkFactory, VetThesisLinkFormFactory -from .forms import RequestThesisLinkForm, VetThesisLinkForm +from ..factories import ThesisLinkFactory, VetThesisLinkFormFactory +from ..forms import RequestThesisLinkForm, VetThesisLinkForm from common.helpers import model_form_data from common.helpers.test import add_groups_and_permissions diff --git a/theses/test_models.py b/theses/tests/test_models.py similarity index 82% rename from theses/test_models.py rename to theses/tests/test_models.py index 659047003..4492f68a2 100644 --- a/theses/test_models.py +++ b/theses/tests/test_models.py @@ -7,8 +7,8 @@ import re from django.test import TestCase from django.core.exceptions import ValidationError -from .models import ThesisLink -from .factories import ThesisLinkFactory +from ..models import ThesisLink +from ..factories import ThesisLinkFactory from common.helpers.test import add_groups_and_permissions diff --git a/theses/test_views.py b/theses/tests/test_views.py similarity index 97% rename from theses/test_views.py rename to theses/tests/test_views.py index e74a86799..234392ae6 100644 --- a/theses/test_views.py +++ b/theses/tests/test_views.py @@ -16,10 +16,10 @@ from scipost.factories import UserFactory, ContributorFactory from comments.factories import CommentFactory from comments.forms import CommentForm from comments.models import Comment -from .views import RequestThesisLink, VetThesisLink, thesis_detail -from .factories import ThesisLinkFactory, ThesisLinkFactory, VetThesisLinkFormFactory -from .models import ThesisLink -from .forms import VetThesisLinkForm +from ..views import RequestThesisLink, VetThesisLink, thesis_detail +from ..factories import ThesisLinkFactory, ThesisLinkFactory, VetThesisLinkFormFactory +from ..models import ThesisLink +from ..forms import VetThesisLinkForm from common.helpers import model_form_data from common.helpers.test import add_groups_and_permissions -- GitLab