Skip to content

Commit

Permalink
Merge pull request #1624 from DDMAL/revert-1619-i1613-breakup-test-views
Browse files Browse the repository at this point in the history
Revert "Break up `test_views.py` so structure matches views directory"
  • Loading branch information
dchiller authored Aug 30, 2024
2 parents 0ebf761 + eed477f commit 32874b5
Show file tree
Hide file tree
Showing 19 changed files with 6,574 additions and 6,726 deletions.
18 changes: 0 additions & 18 deletions django/cantusdb_project/main_app/tests/make_fakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,21 +451,3 @@ def make_fake_source(
source.other_editors.set([make_fake_user()])

return source


def get_random_search_term(target):
"""Helper function for generating a random slice of a string.
Args:
target (str): The content of the field to search.
Returns:
str: A random slice of `target`
"""
if len(target) <= 2:
search_term = target
else:
slice_start = random.randint(0, len(target) - 2)
slice_end = random.randint(slice_start + 2, len(target))
search_term = target[slice_start:slice_end]
return search_term
Loading

0 comments on commit 32874b5

Please sign in to comment.