From 891bf1f8c0d11b0132edf51c2b2b923a80a72d78 Mon Sep 17 00:00:00 2001 From: Todd Dembrey <todd.dembrey@torchbox.com> Date: Mon, 5 Feb 2018 17:39:19 +0000 Subject: [PATCH] fixup! Update the manager to seperate the email activation into a seperate method --- opentech/apply/funds/tests/factories/__init__.py | 9 ++++++++- opentech/apply/funds/tests/factories/blocks.py | 3 +++ opentech/apply/funds/tests/factories/models.py | 14 ++++++++++++++ opentech/apply/funds/tests/test_models.py | 4 ++-- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/opentech/apply/funds/tests/factories/__init__.py b/opentech/apply/funds/tests/factories/__init__.py index 015c78859..c9d2b8eba 100644 --- a/opentech/apply/funds/tests/factories/__init__.py +++ b/opentech/apply/funds/tests/factories/__init__.py @@ -1,2 +1,9 @@ -from .models import * # noqa +from . import models +from .models import * # noqa +from . import blocks from .blocks import * # noqa + +__all__ = [] + +__all__.extend(blocks.__all__) +__all__.extend(models.__all__) diff --git a/opentech/apply/funds/tests/factories/blocks.py b/opentech/apply/funds/tests/factories/blocks.py index 86f862062..de04acc9a 100644 --- a/opentech/apply/funds/tests/factories/blocks.py +++ b/opentech/apply/funds/tests/factories/blocks.py @@ -4,6 +4,9 @@ from opentech.apply.stream_forms.blocks import FormFieldBlock from opentech.apply.funds import blocks +__all__ = ['FormFieldBlock', 'FullNameBlockFactory', 'EmailBlockFactory'] + + class FormFieldBlockFactory(wagtail_factories.StructBlockFactory): class Meta: model = FormFieldBlock diff --git a/opentech/apply/funds/tests/factories/models.py b/opentech/apply/funds/tests/factories/models.py index 9d24c1786..3850da9b1 100644 --- a/opentech/apply/funds/tests/factories/models.py +++ b/opentech/apply/funds/tests/factories/models.py @@ -17,6 +17,20 @@ from opentech.apply.funds.workflow import Action, Phase, Stage, Workflow from . import blocks +__all__ = [ + 'ActionFactory', + 'PhaseFactory', + 'StageFactory', + 'WorkflowFactory', + 'FundTypeFactory', + 'FundFormFactory', + 'ApplicationFormFactory', + 'RoundFactory', + 'LabFactory', + 'LabFormFactory', +] + + class ListSubFactory(factory.SubFactory): def __init__(self, *args, count=0, **kwargs): self.count = count diff --git a/opentech/apply/funds/tests/test_models.py b/opentech/apply/funds/tests/test_models.py index fe2c921fe..7d25e7f5e 100644 --- a/opentech/apply/funds/tests/test_models.py +++ b/opentech/apply/funds/tests/test_models.py @@ -200,7 +200,7 @@ class TestFormSubmission(TestCase): self.assertEqual(ApplicationSubmission.objects.first().user, user) def test_associated_if_logged_in(self): - user = self.User.objects.get_or_create(email=self.email, defaults={'full_name': self.name}) + user, _ = self.User.objects.get_or_create(email=self.email, defaults={'full_name': self.name}) self.assertEqual(self.User.objects.count(), 1) @@ -213,7 +213,7 @@ class TestFormSubmission(TestCase): # This will need to be updated when we hide user information contextually def test_errors_if_blank_user_data_even_if_logged_in(self): - user = self.User.objects.get_or_create(email=self.email, defaults={'full_name': self.name}) + user, _ = self.User.objects.get_or_create(email=self.email, defaults={'full_name': self.name}) self.assertEqual(self.User.objects.count(), 1) -- GitLab