From 731112672682d19284908e0996c15bfcfe4f96cb Mon Sep 17 00:00:00 2001
From: Jonathan Weth <git@jonathanweth.de>
Date: Fri, 21 Jan 2022 15:40:51 +0100
Subject: [PATCH] Add test for profile

---
 aleksis/apps/matrix/tests/test_matrix.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/aleksis/apps/matrix/tests/test_matrix.py b/aleksis/apps/matrix/tests/test_matrix.py
index 7c10984..5efb3a1 100644
--- a/aleksis/apps/matrix/tests/test_matrix.py
+++ b/aleksis/apps/matrix/tests/test_matrix.py
@@ -403,3 +403,17 @@ def test_alias_room_id_using_group(matrix_bot_user):
 
     assert g.matrix_room_id == room.room_id
     assert g.matrix_alias == room.alias
+
+
+def test_matrix_profile():
+    p1 = Person.objects.create(first_name="Test", last_name="Person")
+
+    with pytest.raises(ValueError):
+        profile = MatrixProfile.from_person(p1)
+
+    p1.user = User.objects.create(username="test")
+    p1.save()
+
+    profile = MatrixProfile.from_person(p1)
+
+    assert profile == MatrixProfile.from_person(p1)
-- 
GitLab