Esempio n. 1
0
 def test_get_sentry_link(self, mock_client):
     meta = dict(
         lang='en',
         ver='1.0.0.1',
     )
     app_id = '{D0AB2EBC-931B-4013-9FEB-C9C4C2225C8C}'
     user_id = '{2882CF9B-D9C2-4edb-9AAF-8ED5FCF366F7}'
     with open(CRASH_DUMP_FILE, 'rb') as f:
         obj = Crash.objects.create(
             appid=app_id,
             userid=user_id,
             upload_file_minidump=SimpleUploadedFile('7b05e196-7e23-416b-bd13-99287924e214.dmp', f.read()),
             meta=meta,
         )
     with patch('requests.get') as mocked:
         instance = mocked.return_value
         instance.json.return_value = {'groupID': '1', 'id': '2'}
         get_sentry_link(obj.pk, '123')
     obj = Crash.objects.get(id=obj.id)
     self.assertEqual(obj.eventid, '2')
     self.assertEqual(obj.groupid, '1')
Esempio n. 2
0
 def test_get_sentry_link(self, mock_client):
     meta = dict(
         lang='en',
         version='1.0.0.1',
     )
     app_id = '{D0AB2EBC-931B-4013-9FEB-C9C4C2225C8C}'
     user_id = '{2882CF9B-D9C2-4edb-9AAF-8ED5FCF366F7}'
     with open(CRASH_DUMP_FILE, 'rb') as f:
         obj = Crash.objects.create(
             appid=app_id,
             userid=user_id,
             upload_file_minidump=SimpleUploadedFile('7b05e196-7e23-416b-bd13-99287924e214.dmp', f.read()),
             meta=meta,
         )
     with patch('requests.get') as mocked:
         instance = mocked.return_value
         instance.json.return_value = {'groupID': '1', 'id': '2'}
         get_sentry_link(obj.pk, '123')
     obj = Crash.objects.get(id=obj.id)
     self.assertEqual(obj.eventid, '2')
     self.assertEqual(obj.groupid, '1')