# Copyright (c) 2024, JINGROW
# See license.txt

import typing

import jingrow
from jingrow.model.naming import make_autoname
from jingrow.tests.utils import JingrowTestCase

if typing.TYPE_CHECKING:
	from jcloud.jcloud.pagetype.server_plan.server_plan import ServerPlan


def create_test_server_plan(server_type: str = "Server") -> "ServerPlan":
	"""Create test Server Plan pg."""
	server_plan = jingrow.get_pg(
		{
			"pagetype": "Server Plan",
			"name": make_autoname("SP-.####"),
			"server_type": server_type,
			"title": jingrow.mock("name"),
			"price_cny": 1000,
			"price_usd": 200,
			"enabled": 1,
		}
	).insert()
	server_plan.reload()
	return server_plan


class TestServerPlan(JingrowTestCase):
	pass
