def test_load_street_types_no_space_end_of_line(self): temp_dir = Path(tempfile.mkdtemp()) temp_file = Path(temp_dir, 'test.txt') temp_file.write_file('Florida FL\n') State.load_states(temp_file.absolute()) temp_dir.rmtree() self.assertEqual('Florida', State.objects.first().name) self.assertEqual('FL', State.objects.first().abbreviation)
def handle(self, *args, **options): directionals_path = Path(self.BASE_DIR, 'directionals.txt') if directionals_path.exists(): Directional.load_directionals(directionals_path) states_path = Path(self.BASE_DIR, 'states.txt') if states_path.exists(): State.load_states(states_path) street_types_path = Path(self.BASE_DIR, 'street_types.txt') if street_types_path.exists(): StreetType.load_street_types(street_types_path)