File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ class Cohort(models.Model):
1919 def get_absolute_url (self ):
2020 return reverse ('cohorts:detail' , kwargs = {'slug' : self .slug })
2121
22+ def __str__ (self ):
23+ return f'Turma: { self .title } '
24+
2225 @property
2326 def recorded_webinars (self ):
2427 return [w for w in self .webinars if w .vimeo_id ]
Original file line number Diff line number Diff line change @@ -58,6 +58,10 @@ def test_status_code(resp):
5858 assert 200 == resp .status_code
5959
6060
61+ def test_str (cohort ):
62+ assert str (cohort ) == f'Turma: { cohort .title } '
63+
64+
6165@pytest .mark .parametrize ('property_name' , 'title forum_post' .split ())
6266def test_cohort_properties (cohort , resp , property_name ):
6367 dj_assert_contains (resp , getattr (cohort , property_name ))
You can’t perform that action at this time.
0 commit comments