Esempio n. 1
0
 def test_audiofile_view_bulk_del(self):
     """Test Function to check audio delete"""
     request = self.factory.post('/audio/del/', {'select': '1'},
         follow=True)
     request.user = self.user
     request.session = {}
     response = audio_del(request, 0)
     self.assertEqual(response.status_code, 302)
Esempio n. 2
0
 def test_audiofile_view_bulk_del(self):
     """Test Function to check audio delete"""
     request = self.factory.post('/audio/del/', {'select': '1'},
                                 follow=True)
     request.user = self.user
     request.session = {}
     response = audio_del(request, 0)
     self.assertEqual(response.status_code, 302)
Esempio n. 3
0
 def test_audiofile_view_del(self):
     self.user = User.objects.get(pk=1)
     obj = AudioFile(name='sample_audio', user=self.user)
     obj.save()
     request = self.factory.post('/audio/del/%s/' % str(obj.id), {},
                                 follow=True)
     request.user = self.user
     request.session = {}
     response = audio_del(request, obj.id)
     self.assertEqual(response.status_code, 302)
Esempio n. 4
0
 def test_audiofile_view_del(self):
     self.user = User.objects.get(pk=1)
     obj = AudioFile(name='sample_audio', user=self.user)
     obj.save()
     request = self.factory.post('/audio/del/%s/' % str(obj.id), {},
         follow=True)
     request.user = self.user
     request.session = {}
     response = audio_del(request, obj.id)
     self.assertEqual(response.status_code, 302)