~allenap/maas/rpc-give-shared-secret-to-accepted-cluster

« back to all changes in this revision

Viewing changes to src/maasserver/tests/test_forms.py

[r=allenap][bug=1233833][author=rvb] Avoid fat-fingered bulk actions by putting an empty action as the default action on the node listing page.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1037
1037
            [[], node3.system_id],
1038
1038
            [existing_nodes, node3_system_id])
1039
1039
 
 
1040
    def test_first_action_is_empty(self):
 
1041
        form = BulkNodeActionForm(user=factory.make_admin())
 
1042
        action = form.fields['action']
 
1043
        default_action = action.choices[0][0]
 
1044
        required = action.required
 
1045
        # The default action is the empty string (i.e. no action)
 
1046
        # and it's a required field.
 
1047
        self.assertEqual(('', True), (default_action, required))
 
1048
 
1040
1049
    def test_gives_stat_when_not_applicable(self):
1041
1050
        node1 = factory.make_node(status=NODE_STATUS.DECLARED)
1042
1051
        node2 = factory.make_node(status=NODE_STATUS.FAILED_TESTS)