diff --git a/ccdb/collections_ccdb/factories.py b/ccdb/collections_ccdb/tests/factories.py similarity index 85% rename from ccdb/collections_ccdb/factories.py rename to ccdb/collections_ccdb/tests/factories.py index 736968e..c310c7b 100644 --- a/ccdb/collections_ccdb/factories.py +++ b/ccdb/collections_ccdb/tests/factories.py @@ -4,11 +4,12 @@ from factory import DjangoModelFactory, Sequence, SubFactory, LazyFunction from factory.fuzzy import FuzzyText, FuzzyDate, FuzzyInteger from factory.django import FileField -from .models import CollectionType, CollectionMethod, Flaw, ADFGPermit, Collection, \ - DatasheetAttachment, CollectionTrap -from ..projects.factories import ProjectFactory -from ..locations.factories import StudyLocationFactory, StorageLocationFactory -from ..processing.factories import ProcessTypeFactory, ReagentFactory +from ..models import (CollectionType, CollectionMethod, Flaw, ADFGPermit, + Collection, DatasheetAttachment, CollectionTrap) +from ccdb.projects.tests.factories import ProjectFactory +from ccdb.locations.tests.factories import (StudyLocationFactory, + StorageLocationFactory) +from ccdb.processing.tests.factories import ProcessTypeFactory, ReagentFactory class CollectionTypeFactory(DjangoModelFactory): diff --git a/ccdb/collections_ccdb/tests/test_models.py b/ccdb/collections_ccdb/tests/test_models.py index b9d53e0..849f82d 100644 --- a/ccdb/collections_ccdb/tests/test_models.py +++ b/ccdb/collections_ccdb/tests/test_models.py @@ -1,11 +1,11 @@ from django.test import TestCase from django.db import IntegrityError, transaction -from ..models import CollectionType, CollectionMethod, Flaw, ADFGPermit, \ - Collection, DatasheetAttachment, CollectionTrap -from ..factories import CollectionTypeFactory, CollectionMethodFactory, \ - FlawFactory, ADFGPermitFactory, CollectionFactory, DatasheetAttachmentFactory, \ - CollectionTrapFactory +from ..models import (CollectionType, CollectionMethod, Flaw, ADFGPermit, + Collection, DatasheetAttachment, CollectionTrap) +from .factories import (CollectionTypeFactory, CollectionMethodFactory, + FlawFactory, ADFGPermitFactory, CollectionFactory, + DatasheetAttachmentFactory, CollectionTrapFactory) class CollectionTypeTestCase(TestCase): diff --git a/ccdb/experiments/factories.py b/ccdb/experiments/tests/factories.py similarity index 85% rename from ccdb/experiments/factories.py rename to ccdb/experiments/tests/factories.py index 8f32dc3..9067dfd 100644 --- a/ccdb/experiments/factories.py +++ b/ccdb/experiments/tests/factories.py @@ -1,15 +1,15 @@ from datetime import date, time -from factory import DjangoModelFactory, Sequence, SubFactory, \ - LazyFunction, post_generation +from factory import (DjangoModelFactory, Sequence, SubFactory, LazyFunction, + post_generation) from factory.fuzzy import FuzzyText, FuzzyDate, FuzzyInteger, FuzzyFloat from factory.django import FileField -from .models import Flaw, Experiment, ProtocolAttachment, TreatmentType, \ - Treatment, TreatmentReplicate, AliveDeadCount -from ..misc.factories import ContainerFactory -from ..locations.factories import StudyLocationFactory -from ..species.factories import SpeciesFactory +from ..models import (Flaw, Experiment, ProtocolAttachment, TreatmentType, + Treatment, TreatmentReplicate, AliveDeadCount) +from ccdb.misc.tests.factories import ContainerFactory +from ccdb.locations.tests.factories import StudyLocationFactory +from ccdb.species.tests.factories import SpeciesFactory class FlawFactory(DjangoModelFactory): diff --git a/ccdb/experiments/tests/test_models.py b/ccdb/experiments/tests/test_models.py index 9be378b..8e0a7a2 100644 --- a/ccdb/experiments/tests/test_models.py +++ b/ccdb/experiments/tests/test_models.py @@ -1,11 +1,12 @@ from django.test import TestCase from django.db import IntegrityError, transaction -from ..models import Flaw, Experiment, ProtocolAttachment, TreatmentType, \ - Treatment, TreatmentReplicate, AliveDeadCount -from ..factories import FlawFactory, ExperimentFactory, ProtocolAttachmentFactory, \ - TreatmentTypeFactory, TreatmentFactory, TreatmentReplicateFactory, \ - AliveDeadCountFactory +from ..models import (Flaw, Experiment, ProtocolAttachment, TreatmentType, + Treatment, TreatmentReplicate, AliveDeadCount) +from .factories import (FlawFactory, ExperimentFactory, + ProtocolAttachmentFactory, TreatmentTypeFactory, + TreatmentFactory, TreatmentReplicateFactory, + AliveDeadCountFactory) class FlawTestCase(TestCase): diff --git a/ccdb/locations/factories.py b/ccdb/locations/tests/factories.py similarity index 94% rename from ccdb/locations/factories.py rename to ccdb/locations/tests/factories.py index 82edd29..967eb60 100644 --- a/ccdb/locations/factories.py +++ b/ccdb/locations/tests/factories.py @@ -1,7 +1,8 @@ from factory import DjangoModelFactory, Sequence, SubFactory from factory.fuzzy import FuzzyText, FuzzyChoice, FuzzyInteger -from .models import Region, Site, MunicipalLocation, StudyLocation, StorageLocation +from ..models import (Region, Site, MunicipalLocation, StudyLocation, + StorageLocation) class RegionFactory(DjangoModelFactory): diff --git a/ccdb/locations/tests/test_models.py b/ccdb/locations/tests/test_models.py index 01c94f9..94a18ab 100644 --- a/ccdb/locations/tests/test_models.py +++ b/ccdb/locations/tests/test_models.py @@ -1,9 +1,10 @@ from django.test import TestCase from django.db import IntegrityError, transaction -from ..models import Region, Site, MunicipalLocation, StudyLocation, StorageLocation -from ..factories import RegionFactory, SiteFactory, MunicipalLocationFactory, \ - StudyLocationFactory, StorageLocationFactory +from ..models import (Region, Site, MunicipalLocation, StudyLocation, + StorageLocation) +from .factories import (RegionFactory, SiteFactory, MunicipalLocationFactory, + StudyLocationFactory, StorageLocationFactory) class RegionTestCase(TestCase): diff --git a/ccdb/misc/factories.py b/ccdb/misc/tests/factories.py similarity index 94% rename from ccdb/misc/factories.py rename to ccdb/misc/tests/factories.py index c0fc42b..cc84645 100644 --- a/ccdb/misc/factories.py +++ b/ccdb/misc/tests/factories.py @@ -1,6 +1,7 @@ import factory -from .models import MeasurementUnit, MeasurementType, Material, Color, Container +from ..models import (MeasurementUnit, MeasurementType, Material, Color, + Container) class MeasurementUnitFactory(factory.DjangoModelFactory): diff --git a/ccdb/misc/tests/test_models.py b/ccdb/misc/tests/test_models.py index 02d2e06..d3a95f7 100644 --- a/ccdb/misc/tests/test_models.py +++ b/ccdb/misc/tests/test_models.py @@ -1,9 +1,10 @@ from django.test import TestCase from django.db import IntegrityError, transaction -from ..models import MeasurementUnit, MeasurementType, Material, Color, Container -from ..factories import MeasurementUnitFactory, MeasurementTypeFactory, \ - MaterialFactory, ColorFactory, ContainerFactory +from ..models import (MeasurementUnit, MeasurementType, Material, Color, + Container) +from .factories import (MeasurementUnitFactory, MeasurementTypeFactory, + MaterialFactory, ColorFactory, ContainerFactory) class MeasurementUnitTestCase(TestCase): diff --git a/ccdb/processing/factories.py b/ccdb/processing/tests/factories.py similarity index 91% rename from ccdb/processing/factories.py rename to ccdb/processing/tests/factories.py index 9e475ab..cc0a33c 100644 --- a/ccdb/processing/factories.py +++ b/ccdb/processing/tests/factories.py @@ -3,8 +3,8 @@ from datetime import datetime, date from factory import DjangoModelFactory, Sequence, SubFactory, LazyFunction from factory.fuzzy import FuzzyText, FuzzyDate, FuzzyFloat, FuzzyInteger -from .models import ProcessType, Reagent, Flaw, Processing -from ..misc.factories import ContainerFactory, MeasurementUnitFactory +from ..models import ProcessType, Reagent, Flaw, Processing +from ccdb.misc.tests.factories import ContainerFactory, MeasurementUnitFactory class ProcessTypeFactory(DjangoModelFactory): diff --git a/ccdb/processing/tests/test_models.py b/ccdb/processing/tests/test_models.py index 74d02bf..eb39456 100644 --- a/ccdb/processing/tests/test_models.py +++ b/ccdb/processing/tests/test_models.py @@ -2,7 +2,8 @@ from django.test import TestCase from django.db import IntegrityError, transaction from ..models import ProcessType, Reagent, Flaw, Processing -from ..factories import ProcessTypeFactory, ReagentFactory, FlawFactory, ProcessingFactory +from .factories import (ProcessTypeFactory, ReagentFactory, FlawFactory, + ProcessingFactory) class ProcessTypeTestCase(TestCase): diff --git a/ccdb/projects/factories.py b/ccdb/projects/tests/factories.py similarity index 95% rename from ccdb/projects/factories.py rename to ccdb/projects/tests/factories.py index 64cdbf2..15c6c86 100644 --- a/ccdb/projects/factories.py +++ b/ccdb/projects/tests/factories.py @@ -2,7 +2,7 @@ from datetime import datetime import factory -from .models import Project, Grant, GrantReport +from ..models import Project, Grant, GrantReport class ProjectFactory(factory.DjangoModelFactory): diff --git a/ccdb/projects/tests/test_models.py b/ccdb/projects/tests/test_models.py index b1a4b6e..ee04d3d 100644 --- a/ccdb/projects/tests/test_models.py +++ b/ccdb/projects/tests/test_models.py @@ -2,7 +2,7 @@ from django.test import TestCase from django.db import IntegrityError, transaction from ..models import Project, Grant, GrantReport -from ..factories import ProjectFactory, GrantFactory, GrantReportFactory +from .factories import ProjectFactory, GrantFactory, GrantReportFactory class ProjectTestCase(TestCase): diff --git a/ccdb/species/factories.py b/ccdb/species/tests/factories.py similarity index 83% rename from ccdb/species/factories.py rename to ccdb/species/tests/factories.py index 43f873e..3f8ae30 100644 --- a/ccdb/species/factories.py +++ b/ccdb/species/tests/factories.py @@ -1,9 +1,9 @@ from factory import DjangoModelFactory, Sequence, SubFactory from factory.fuzzy import FuzzyText, FuzzyChoice, FuzzyInteger -from .models import Species, TrapSpecies, CollectionSpecies -from ..collections_ccdb.factories import (CollectionFactory, - CollectionTrapFactory) +from ..models import Species, TrapSpecies, CollectionSpecies +from ccdb.collections_ccdb.tests.factories import (CollectionFactory, + CollectionTrapFactory) class SpeciesFactory(DjangoModelFactory): diff --git a/ccdb/species/tests/test_models.py b/ccdb/species/tests/test_models.py index df42b7a..442d9ee 100644 --- a/ccdb/species/tests/test_models.py +++ b/ccdb/species/tests/test_models.py @@ -2,8 +2,8 @@ from django.test import TestCase from django.db import IntegrityError, transaction from ..models import Species, TrapSpecies, CollectionSpecies -from ..factories import (SpeciesFactory, TrapSpeciesFactory, - CollectionSpeciesFactory) +from .factories import (SpeciesFactory, TrapSpeciesFactory, + CollectionSpeciesFactory) class SpeciesTestCase(TestCase): diff --git a/ccdb/users/factories.py b/ccdb/users/tests/factories.py similarity index 90% rename from ccdb/users/factories.py rename to ccdb/users/tests/factories.py index 8c11276..9aa5227 100644 --- a/ccdb/users/factories.py +++ b/ccdb/users/tests/factories.py @@ -1,6 +1,6 @@ from factory import DjangoModelFactory, Sequence -from .models import User +from ..models import User class UserFactory(DjangoModelFactory): diff --git a/ccdb/users/tests/test_models.py b/ccdb/users/tests/test_models.py index 72f47f1..7154041 100644 --- a/ccdb/users/tests/test_models.py +++ b/ccdb/users/tests/test_models.py @@ -2,7 +2,7 @@ from django.test import TestCase from django.db import IntegrityError, transaction from ..models import User -from ..factories import UserFactory +from .factories import UserFactory class UserTestCase(TestCase):