Remove trailing comma from the text representation

This commit is contained in:
Roland Geider
2024-10-23 14:37:32 +02:00
parent 49bbd18997
commit 8dbc0096e2
3 changed files with 10 additions and 1 deletions

0
manage.py Normal file → Executable file
View File

View File

@@ -135,7 +135,7 @@ class SetConfigData:
rir = round_value(self.rir, 0.5)
out.append(f'@ {rir} {_("RiR")}')
return ' '.join(out)
return ' '.join(out).strip(',')
@dataclass

View File

@@ -104,6 +104,15 @@ class SetConfigDataTestCase(WgerTestCase):
self.config.max_weight = 30
self.assertEqual(self.config.text_repr, '3 Sets, 4 × 20-30 kg @ 3 RiR')
def test_text_repr_only_sets(self):
self.config.sets = 3
self.config.weight = None
self.config.max_weight = None
self.config.max_reps = None
self.config.reps = None
self.config.rir = None
self.assertEqual(self.config.text_repr, '3 Sets')
def test_rpe_calculation(self):
self.assertEqual(self.config.rpe, 7)