def test_location_set_from_terminal(admin_user):
operator = Operator.objects.get_or_create(user=admin_user)[0]
terminal = ParkingTerminal.objects.get_or_create(
number=4567, defaults={
'location': Point(61, 25), 'name': "Test terminal"})[0]
parking = create_parking(operator_id=operator.pk, terminal_number=4567)
parking.location = None
parking.save()
assert parking.location == terminal.location
评论列表
文章目录