Example #1
0
    def test_contact_view_delete(self):
        """Test Function to check delete contact"""
        request = self.factory.get('/contact/del/1/')
        request.user = self.user
        request.session = {}
        response = contact_del(request, 1)
        self.assertEqual(response.status_code, 302)

        request = self.factory.post('/contact/del/', {'select': '1'})
        request.user = self.user
        request.session = {}
        response = contact_del(request, 0)
        self.assertEqual(response.status_code, 302)
Example #2
0
    def test_contact_view_delete(self):
        """Test Function to check delete contact"""
        request = self.factory.get('/contact/del/1/')
        request.user = self.user
        request.session = {}
        response = contact_del(request, 1)
        self.assertEqual(response.status_code, 302)

        request = self.factory.post('/contact/del/', {'select': '1'})
        request.user = self.user
        request.session = {}
        response = contact_del(request, 0)
        self.assertEqual(response.status_code, 302)