# Copyright (c) 2023, Jingrow and Contributors
# See license.txt

import jingrow
from jingrow.tests.utils import JingrowTestCase

from jcloude.jcloude.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": "Jcloude Tag",
			"pagetype_name": pagetype,
			"team": create_test_team().name,
			"tag": tag,
		}
	).insert(ignore_permissions=True)
	pg = jingrow.get_pg(pagetype, name).append("tags", {"tag": test_tag.name})
	pg.save()
	return test_tag


class TestJcloudeTag(JingrowTestCase):
	pass
