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

import jingrow
from jingrow.tests.utils import JingrowTestCase

from jcloud.jcloud.pagetype.team.test_team import create_test_team


def create_and_add_test_tag(name: str, pagetype: str, tag: str = "test_tag"):
	test_tag = jingrow.get_pg(
		{
			"pagetype": "Jcloud Tag",
			"pagetype_name": pagetype,
			"team": create_test_team(),
			"tag": tag,
		}
	).insert(ignore_permissions=True)
	pg = jingrow.get_pg(pagetype, name).append("tags", {"tag": test_tag})
	pg.save()
	return test_tag


class TestJcloudTag(JingrowTestCase):
	pass
