Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
n00rsy committed Oct 10, 2024
1 parent 0b025cf commit 66e2677
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pybossa/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def datetime_filter(source, fmt):
def validate_ownership_id(o_id):
ownership_id_title = current_app.config.get('OWNERSHIP_ID_TITLE', 'Ownership ID')
if o_id == None or len(o_id) == 0:
return True
return
if not (o_id.isnumeric() and len(o_id) <= 20):
raise ValueError(f"{ownership_id_title} must be numeric and less than 20 characters. Got: {o_id}")

Expand Down
4 changes: 2 additions & 2 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1909,8 +1909,8 @@ def test_validate_ownership_id(self):
ownership_id = ""
util.validate_ownership_id(ownership_id)

# ownership_id too long
ownership_id = "12341234123412341234"
# ownership_id too long (> 20 chars)
ownership_id = "123412341234123412341234"
assert_raises(ValueError, util.validate_ownership_id, ownership_id)

# ownership_id not numeric
Expand Down

0 comments on commit 66e2677

Please sign in to comment.