def test_dataset_api_create_with_legacy_frequency(self): '''It should create a dataset from the API with a legacy frequency''' self.login() for oldFreq, newFreq in LEGACY_FREQUENCIES.items(): data = DatasetFactory.as_dict() data['frequency'] = oldFreq response = self.post(url_for('api.datasets'), data) self.assert201(response) self.assertEqual(response.json['frequency'], newFreq)
def test_legacy_frequencies(self): for oldFreq, newFreq in LEGACY_FREQUENCIES.items(): dataset = DatasetFactory(frequency=oldFreq) self.assertEqual(dataset.frequency, newFreq)
def test_legacy_frequencies(self): for oldFreq, newFreq in LEGACY_FREQUENCIES.items(): dataset = DatasetFactory(frequency=oldFreq) assert dataset.frequency == newFreq