def setUp(self): self.user = User.objects.create(username='******') self.st = SiderealTargetFactory.create(name='testtarget') self.st2 = SiderealTargetFactory.create(name='testtarget2') self.st3 = SiderealTargetFactory.create(name='testtarget3') self.obsr = ObservingRecordFactory.create(target_id=self.st.id, user=self.user) self.obsr2 = ObservingRecordFactory.create(target_id=self.st2.id) self.obsr3 = ObservingRecordFactory.create(target_id=self.st3.id) assign_perm('tom_targets.view_target', self.user, self.st2) self.client.force_login(self.user)
def setUp(self): self.user = User.objects.create(username='******') self.st = SiderealTargetFactory.create(name='testtarget') self.obsr = ObservingRecordFactory.create(target_id=self.st.id, user=self.user, status='PENDING') self.obsr2 = ObservingRecordFactory.create(target_id=self.st.id, status='PENDING') self.obsr3 = ObservingRecordFactory.create(target_id=self.st.id, status='PENDING') assign_perm('tom_observations.view_observationrecord', self.user, self.obsr2) assign_perm('tom_observations.change_observationrecord', self.user, self.obsr2) self.client.force_login(self.user)
def setUp(self): self.target = SiderealTargetFactory.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)
def setUp(self): self.user = User.objects.create(username='******') self.client.force_login(self.user) self.st = SiderealTargetFactory.create() self.obsr = ObservingRecordFactory.create(target_id=self.st.id) self.dp_data = { 'product_id': 'test_product_id', 'target': self.st.id, 'data_product_type': 'photometry' } assign_perm('tom_dataproducts.add_dataproduct', self.user) assign_perm('tom_targets.add_target', self.user, self.st) assign_perm('tom_targets.view_target', self.user, self.st) assign_perm('tom_targets.change_target', self.user, self.st)
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')) 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) self.client.force_login(self.user)
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')}
def setUp(self): self.target = SiderealTargetFactory.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')}