예제 #1
0
 def setUp(self):
     self.target = TargetFactory.create()
     self.data_product = DataProduct.objects.create(target=self.target,
                                                    data=SimpleUploadedFile(
                                                        'afile.fits',
                                                        b'somedata'))
     self.data_processor = DataProcessor()
예제 #2
0
 def setUp(self):
     self.target = TargetFactory.create()
     self.observation_record = ObservingRecordFactory.create(
         target_id=self.target.id,
         facility=FakeRoboticFacility.name,
         parameters='{}')
     self.data_product = DataProduct.objects.create(
         product_id='testproductid',
         target=self.target,
         observation_record=self.observation_record,
         data=SimpleUploadedFile('afile.fits', b'somedata'))
     user = User.objects.create_user(username='******',
                                     email='*****@*****.**')
     assign_perm('tom_targets.view_target', user, self.target)
     self.client.force_login(user)
예제 #3
0
 def setUp(self):
     self.target = TargetFactory.create()
     self.data_product = DataProduct.objects.create(
         product_id='testproductid',
         target=self.target,
         data=SimpleUploadedFile('afile.fits', b'somedata'))
     self.user = User.objects.create_user(username='******',
                                          email='*****@*****.**')
     self.user2 = User.objects.create_user(username='******',
                                           email='*****@*****.**')
     assign_perm('tom_targets.view_target', self.user, self.target)
     assign_perm('tom_targets.view_target', self.user2, self.target)
     assign_perm('tom_targets.view_dataproduct', self.user,
                 self.data_product)
     assign_perm('tom_targets.view_dataproduct', self.user2,
                 self.data_product)
     assign_perm('tom_targets.delete_dataproduct', self.user,
                 self.data_product)
     self.client.force_login(self.user)
예제 #4
0
 def setUp(self):
     self.target = TargetFactory.create()
     self.observation_record = ObservingRecordFactory.create(
         target_id=self.target.id,
         facility=FakeFacility.name,
         parameters='{}')
     self.spectroscopy_form_data = {
         'target': self.target.id,
         'tag': SPECTROSCOPY[0],
         'facility': 'LCO',
         'observation_timestamp_0': date(2019, 6, 1),
         'observation_timestamp_1': time(12, 0, 0),
         'referrer': 'referrer'
     }
     self.photometry_form_data = {
         'target': self.target.id,
         'tag': PHOTOMETRY[0],
         'referrer': 'referrer'
     }
     self.file_data = {'files': SimpleUploadedFile('afile.fits', b'afile')}
예제 #5
0
 def setUp(self):
     self.target = TargetFactory.create()
     self.observation_record = ObservingRecordFactory.create(
         target_id=self.target.id,
         facility=FakeRoboticFacility.name,
         parameters='{}')
     self.spectroscopy_form_data = {
         'target': self.target.id,
         'data_product_type':
         settings.DATA_PRODUCT_TYPES['spectroscopy'][0],
         'facility': 'LCO',
         'observation_timestamp_0': date(2019, 6, 1),
         'observation_timestamp_1': time(12, 0, 0),
         'referrer': 'referrer'
     }
     self.photometry_form_data = {
         'target': self.target.id,
         'data_product_type': settings.DATA_PRODUCT_TYPES['photometry'][0],
         'referrer': 'referrer'
     }
     self.file_data = {'files': SimpleUploadedFile('afile.fits', b'afile')}
예제 #6
0
 def setUp(self):
     self.target = TargetFactory.create()
     self.data_product = DataProduct.objects.create(target=self.target)
     self.spectrum_data_processor = SpectroscopyProcessor()
     self.photometry_data_processor = PhotometryProcessor()
     self.test_file = SimpleUploadedFile('afile.fits', b'somedata')