def test_corrupted_archive(self): corrupted_archive_region = models.RegionModel.objects.get(name = u'Corrupted archive') try: data_import.import_region(corrupted_archive_region) except osm_import.ShapefileArchiveError: got_exception = True else: got_exception = False self.assertTrue(got_exception)
def test_nonexistent_archive(self): nonexistent_archive_region = models.RegionModel.objects.get(name = u'Nonexistent archive') try: data_import.import_region(nonexistent_archive_region) except osm_import.ShapefileArchiveError: got_exception = True else: got_exception = False self.assertTrue(got_exception)
def test_normal_import(self): cutted_region = models.RegionModel.objects.get(name = u'Cutted') data_import.import_region(cutted_region) for model in [models.RegionBorderModel, models.WaterModel, models.ForestModel, models.SettlementModel, models.HighwayModel, models.RailwayStationModel]: self.assertTrue(model.objects.count() > 0)