def test_my_callback_signal(self): """ This is function verify if correct work my own signal """ obj = StorageRequests(pk=1) obj.host = 'My_own_host' obj.save() work = LogWorks.objects.all()[0] self.assertEqual(work.mod_name, 'StorageRequests') self.assertEqual(work.work, 'creation')
def process_request(self, request): ''' Object for HttpRequest ''' rqst = StorageRequests() rqst.host = request.get_host() rqst.path = request.get_full_path() rqst.method = request.method rqst.save()