Skip to content

Commit 1ced9c0

Browse files
空文字があり得る項目のテストケースを追加
1 parent abe0a62 commit 1ced9c0

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

shared-local-instance.db

0 Bytes
Binary file not shown.

tests/handlers/me/articles/fraud/create/test_me_articles_fraud_create.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,19 @@ def test_validation_required_plagiarism_detail_when_reason_is_plagiarism(self):
391391
params = dict(self.get_parameters_other_than_body_for_validate(), **body)
392392
self.assert_bad_request(params)
393393

394+
def test_validation_empty_plagiarism_detail_when_reason_is_plagiarism(self):
395+
body = {
396+
'body': json.dumps(
397+
{
398+
'reason': 'plagiarism',
399+
'plagiarism_url': '',
400+
'plagiarism_description': ''
401+
}
402+
)
403+
}
404+
params = dict(self.get_parameters_other_than_body_for_validate(), **body)
405+
self.assert_bad_request(params)
406+
394407
def test_validation_invalid_plagiarism_url_when_reason_is_plagiarism(self):
395408
body = {
396409
'body': json.dumps(
@@ -414,6 +427,18 @@ def test_validation_required_illegal_content_when_reason_is_illegal(self):
414427
params = dict(self.get_parameters_other_than_body_for_validate(), **body)
415428
self.assert_bad_request(params)
416429

430+
def test_validation_empty_illegal_content_when_reason_is_illegal(self):
431+
body = {
432+
'body': json.dumps(
433+
{
434+
'reason': 'illegal',
435+
'illegal_content': ''
436+
}
437+
)
438+
}
439+
params = dict(self.get_parameters_other_than_body_for_validate(), **body)
440+
self.assert_bad_request(params)
441+
417442
def test_validation_required_illegal_content_when_reason_is_other(self):
418443
body = {
419444
'body': json.dumps(
@@ -425,6 +450,18 @@ def test_validation_required_illegal_content_when_reason_is_other(self):
425450
params = dict(self.get_parameters_other_than_body_for_validate(), **body)
426451
self.assert_bad_request(params)
427452

453+
def test_validation_empty_illegal_content_when_reason_is_other(self):
454+
body = {
455+
'body': json.dumps(
456+
{
457+
'reason': 'other',
458+
'illegal_content': ''
459+
}
460+
)
461+
}
462+
params = dict(self.get_parameters_other_than_body_for_validate(), **body)
463+
self.assert_bad_request(params)
464+
428465
def test_validation_plagiarism_description_max(self):
429466
body = {
430467
'body': json.dumps(

0 commit comments

Comments
 (0)