@@ -226,7 +226,8 @@ def test_upload_spectroscopy_datum(self):
226226 payload = {
227227 "data_product" : "" ,
228228 "data_type" : "spectroscopy" ,
229- "value" : {"flux" : [123.4 , 4.321 ], "wavelength" : [150 , 151 ], "error" : [0.005 ], "flux_unit" : "s" },
229+ "value" : {"flux" : [123.4 , 4.321 ], "wavelength" : [150 , 151 ], "error" : [0.005 ], "flux_unit" : "s" ,
230+ "wavelength_unit" : "Angstrom" },
230231 "target" : self .st .id ,
231232 "timestamp" : "2012-02-12T01:40:47Z" ,
232233 }
@@ -303,7 +304,7 @@ def test_spectroscopy_representation(self):
303304 """SpectroscopyReducedDatum is serialized to the legacy wire format."""
304305 SpectroscopyReducedDatum .objects .create (
305306 target = self .st , flux = [1.0 , 2.0 ], wavelength = [6000.0 , 6001.0 ],
306- error = [0.1 , 0.1 ], flux_unit = 'erg/cm2/s/A'
307+ error = [0.1 , 0.1 ], flux_unit = 'erg/cm2/s/A' , wavelength_unit = "um" ,
307308 )
308309
309310 result = self .client .get (reverse ('api:reduceddatums-list' )).data ['results' ][0 ]
@@ -313,6 +314,7 @@ def test_spectroscopy_representation(self):
313314 self .assertEqual (result ['value' ]['wavelength' ], [6000.0 , 6001.0 ])
314315 self .assertEqual (result ['value' ]['error' ], [0.1 , 0.1 ])
315316 self .assertEqual (result ['value' ]['flux_unit' ], 'erg/cm2/s/A' )
317+ self .assertEqual (result ['value' ]['wavelength_unit' ], 'um' )
316318
317319 def test_astrometry_representation (self ):
318320 """AstrometryReducedDatum is serialized to the legacy wire format."""
0 commit comments