File tree 2 files changed +28
-0
lines changed
backend/communities/groups/tests
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ # SPDX-License-Identifier: AGPL-3.0-or-later
2
+ """
3
+ Test cases for the GroupImage model.
4
+ """
5
+
6
+ import pytest
7
+
8
+ from communities .groups .factories import GroupFactory , GroupImageFactory
9
+ from content .factories import ImageFactory
10
+
11
+ pytestmark = pytest .mark .django_db
12
+
13
+
14
+ def test_group_image_str () -> None :
15
+ """Test string representation of GroupImage model."""
16
+ group = GroupFactory ()
17
+ image = ImageFactory ()
18
+ group_image = GroupImageFactory (group = group , image = image , sequence_index = 1 )
19
+
20
+ assert str (group_image ) == f"{ group_image .id } "
Original file line number Diff line number Diff line change @@ -45,3 +45,11 @@ def test_group_text_languages() -> None:
45
45
assert secondary_text .primary is False
46
46
assert secondary_text .iso == "spa"
47
47
assert secondary_text .description == "Description"
48
+
49
+
50
+ def test_group_text_str_representation () -> None :
51
+ """Test string representation of GroupText model."""
52
+ group = GroupFactory ()
53
+ group_text = GroupTextFactory (group = group , iso = "eng" )
54
+
55
+ assert str (group_text ) == f"{ group_text .group } - { group_text .iso } "
You can’t perform that action at this time.
0 commit comments