Skip to content

Commit c3a170d

Browse files
JacobCoffeeclaude
andcommitted
test job posting url case and line breaks
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 70b9659 commit c3a170d

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎apps/sponsors/tests/test_job_postings.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,23 @@ def test_composes_rows_into_one_job_per_line_skipping_blank_rows(self):
6767
],
6868
)
6969

70+
def test_mixed_case_link_scheme_round_trips(self):
71+
value = self.clean([{"title": "Engineer", "location": "", "url": "HTTPS://example.com/Jobs/1"}])
72+
73+
self.assertEqual(value, "Engineer | https://example.com/Jobs/1")
74+
self.assertEqual(
75+
parse_job_postings("Engineer | Remote | Http://example.com/1"),
76+
[{"title": "Engineer", "location": "Remote", "url": "Http://example.com/1"}],
77+
)
78+
79+
def test_line_breaks_inside_a_row_stay_on_one_stored_line(self):
80+
rows = [{"title": "Senior\u2028Python\nEngineer", "location": "Remote\r\nEU", "url": "https://example.com/1"}]
81+
82+
value = self.clean(rows)
83+
84+
self.assertEqual(value, "Senior Python Engineer | Remote EU | https://example.com/1")
85+
self.assertEqual(len(parse_job_postings(value)), 1)
86+
7087
def test_every_job_needs_a_title_and_a_valid_link_without_separator(self):
7188
rows = [
7289
{"title": "", "location": "", "url": "https://example.com/1"},

0 commit comments

Comments
 (0)