Add unit test

This commit is contained in:
Ramon Wenger 2024-04-26 13:48:05 +02:00
parent e1c53b99da
commit 4594060aa4
1 changed files with 12 additions and 0 deletions

View File

@ -273,6 +273,18 @@ class TestCreateCustomContentBlock:
assert subtitle_block.get("id") is not None assert subtitle_block.get("id") is not None
assert subtitle_block.get("value").get("text") == value.get("text") assert subtitle_block.get("value").get("text") == value.get("text")
def test_add_solution(self, teacher, get_client):
content_type = "solution"
value = {"text": "some solution"}
client = get_client(teacher)
input = create_block_input(content_type=content_type, value=value)
new_content_block = self._add_content_block(client=client, input=input)
subtitle_block = new_content_block.contents.raw_data[0]
assert subtitle_block.get("id") is not None
assert subtitle_block.get("value").get("text") == "<p>{}</p>".format(
value.get("text")
)
# def test_add_readonly(self): # def test_add_readonly(self):
# content_type = "readonly" # content_type = "readonly"
# value = {"text": "some subtitle"} # value = {"text": "some subtitle"}