Exemple #1
0
 def test_get_snapshot_status_choices_without_current(self):
     current_status = {'status': 'available'}
     status_choices = forms.populate_status_choices(current_status,
                                                    forms.STATUS_CHOICES)
     self.assertEqual(len(status_choices), len(forms.STATUS_CHOICES))
     self.assertNotIn(current_status['status'],
                      [status[0] for status in status_choices])
Exemple #2
0
 def test_get_volume_status_choices_without_current(self):
     current_status = {'status': 'available'}
     status_choices = forms.populate_status_choices(current_status,
                                                    forms.STATUS_CHOICES)
     self.assertEqual(len(status_choices), len(forms.STATUS_CHOICES))
     self.assertNotIn(current_status['status'],
                      [status[0] for status in status_choices])
Exemple #3
0
    def __init__(self, request, *args, **kwargs):
        super(UpdateStatus, self).__init__(request, *args, **kwargs)

        initial = kwargs.get("initial", {})
        self.fields["status"].choices = populate_status_choices(initial, STATUS_CHOICES)
Exemple #4
0
    def __init__(self, request, *args, **kwargs):
        super(UpdateStatus, self).__init__(request, *args, **kwargs)

        initial = kwargs.get('initial', {})
        self.fields['status'].choices = (
            populate_status_choices(initial, STATUS_CHOICES))
Exemple #5
0
 def test_get_volume_status_choices_without_current(self):
     current_status = {"status": "available"}
     status_choices = forms.populate_status_choices(current_status, forms.STATUS_CHOICES)
     self.assertEqual(len(status_choices), len(forms.STATUS_CHOICES))
     self.assertNotIn(current_status["status"], [status[0] for status in status_choices])