Esempio n. 1
0
 def test_form_save(self):
     form_data = {
         'user': self.user.id,
         'target': "http://example.com",
         'event': HookForm.get_admin_events()[0][0]
     }
     form = HookForm(data=form_data)
     form.is_valid()
     self.assertTrue(form.is_valid())
     instance = form.save()
     self.assertIsInstance(instance, Hook)
Esempio n. 2
0
    def test_valid_form(self):

        form_data = {
            'target': "http://example.com",
            'event': HookForm.ADMIN_EVENTS[0][0]
        }
        form = HookForm(data=form_data)
        self.assertTrue(form.is_valid())
Esempio n. 3
0
    def test_valid_form(self):

        form_data = {
            'target': "http://example.com",
            'event': HookForm.ADMIN_EVENTS[0][0]
        }
        form = HookForm(data=form_data)
        self.assertTrue(form.is_valid())
Esempio n. 4
0
    def test_valid_form(self):

        form_data = {
            'user': self.user.id,
            'target': "http://example.com",
            'event': HookForm.get_admin_events()[0][0]
        }
        form = HookForm(data=form_data)
        self.assertTrue(form.is_valid())
Esempio n. 5
0
    def test_valid_form(self):

        form_data = {
            'user': self.user.id,
            'target': "http://example.com",
            'event': HookForm.get_admin_events()[0][0]
        }
        form = HookForm(data=form_data)
        self.assertTrue(form.is_valid())
Esempio n. 6
0
    def test_form_save(self):
        form_data = {
            'target': "http://example.com",
            'event': HookForm.ADMIN_EVENTS[0][0]
        }
        form = HookForm(data=form_data)

        self.assertTrue(form.is_valid())
        instance = form.save()
        self.assertIsInstance(instance, Hook)
Esempio n. 7
0
    def test_form_save(self):
        form_data = {
            'target': "http://example.com",
            'event': HookForm.ADMIN_EVENTS[0][0]
        }
        form = HookForm(data=form_data)

        self.assertTrue(form.is_valid())
        instance = form.save()
        self.assertIsInstance(instance, Hook)
Esempio n. 8
0
    def test_form_save(self):
        form_data = {
            'user': self.user.id,
            'target': "http://example.com",
            'event': HookForm.get_admin_events()[0][0]
        }
        form = HookForm(data=form_data)

        self.assertTrue(form.is_valid())
        instance = form.save()
        self.assertIsInstance(instance, Hook)
Esempio n. 9
0
 def test_invalid_form(self):
     form = HookForm(data={})
     self.assertFalse(form.is_valid())
Esempio n. 10
0
 def test_invalid_form(self):
     form = HookForm(data={})
     self.assertFalse(form.is_valid())