Beispiel #1
0
    def test_multiple_select_data(self):
        form = JSONTestForm({'json_data': ['SA', 'WA']})
        assert form.is_valid()

        self.assertEqual(['SA', 'WA'], form.cleaned_data['json_data'])
Beispiel #2
0
 def test_form_clean(self):
     form = JSONTestForm({})
     self.assertFalse(form.is_valid())
Beispiel #3
0
 def test_form_clean(self):
     form = JSONTestForm({})
     self.assertFalse(form.is_valid())
Beispiel #4
0
 def test_multiple_select_data(self):
     form = JSONTestForm({'json_data': ['SA', 'WA']})
     assert form.is_valid()
     
     self.assertEqual(['SA', 'WA'], form.cleaned_data['json_data'])
Beispiel #5
0
    def test_multiple_select_data(self):
        form = JSONTestForm({"json_data": ["SA", "WA"]})
        assert form.is_valid()

        self.assertEqual(["SA", "WA"], form.cleaned_data["json_data"])