Beispiel #1
0
    def test_form_save_with_valid_data(self):

        section = Section.objects.create(pk=1, **self.section_data)

        data = {
            'link': 'http://google.com',
            'title': 'hello',
            'description': 'hello world',
            'section': section.pk,
        }

        form = AddNewsForm(data)

        self.assertTrue(form.is_valid())
    def test_form_save_with_valid_data(self):

        section = Section.objects.create(pk=1, **self.section_data)

        data = {
            'link': 'http://google.com',
            'title': 'hello',
            'description': 'hello world',
            'section': section.pk,
        }

        form = AddNewsForm(data)

        self.assertTrue(form.is_valid())