Review: Needs Fixing


Diff comments:

> diff --git a/src/maasserver/forms/tests/test_pods.py 
> b/src/maasserver/forms/tests/test_pods.py
> index fbdeaef..bb3c6fc 100644
> --- a/src/maasserver/forms/tests/test_pods.py
> +++ b/src/maasserver/forms/tests/test_pods.py
> @@ -638,6 +638,25 @@ class 
> TestComposeMachineForm(MAASTransactionServerTestCase):
>              ),
>          )
>  
> +    def test_sets_up_fields_based_on_pod_no_architectures(self):
> +        request = MagicMock()
> +        pod = make_pod_with_hints()
> +        pod.architectures = []
> +        form = ComposeMachineForm(request=request, pod=pod)
> +        self.assertThat(

don't introduce any more `assertThat`s

self.assertFalse(form.fields["architecture"].required"))
self.assertEqual(form.fields["architecture"].choices, pod.architectures)

> +            form.fields["architecture"],
> +            MatchesStructure(
> +                required=Equals(False),
> +                choices=MatchesSetwise(
> +                    *[
> +                        Equals((architecture, architecture))
> +                        for architecture in pod.architectures
> +                    ]
> +                ),
> +            ),
> +        )
> +        self.assertNotIn("architecture", form.initial)
> +
>      def test_sets_up_fields_based_on_pod_no_max_cpu_speed(self):
>          request = MagicMock()
>          pod = make_pod_with_hints()


-- 
https://code.launchpad.net/~igor-brovtsin/maas/+git/maas/+merge/434359
Your team MAAS Committers is subscribed to branch maas:master.


-- 
Mailing list: https://launchpad.net/~sts-sponsors
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sts-sponsors
More help   : https://help.launchpad.net/ListHelp

Reply via email to