Skip to content

Commit

Permalink
Extend coverage config
Browse files Browse the repository at this point in the history
  • Loading branch information
yalef committed Dec 1, 2023
1 parent 9859768 commit 65315cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions import_export_extensions/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ def clean(
"""
if not value:
return []
return [] # pragma: no cover

# if value is one integer number
value = str(value)

# in some cases if click `enter` values `\n\r` inserted
if self.instance_separator == "\n":
if self.instance_separator == "\n": # pragma: no cover
value = value.replace("\r", "")

raw_instances = utils.clean_sequence_of_string_values(
Expand Down Expand Up @@ -287,7 +287,7 @@ def __init__(self, filename: str):
def render(self, value: Model, *args, **kwargs) -> typing.Optional[str]:
"""Convert DB value to URL to file."""
if not value:
return None
return None # pragma: no cover

if self._get_default_storage() == DEFAULT_SYSTEM_STORAGE:
return f"http://localhost:8000{value.url}"
Expand All @@ -297,7 +297,7 @@ def render(self, value: Model, *args, **kwargs) -> typing.Optional[str]:
def clean(self, value: str, *args, **kwargs) -> typing.Optional[str]:
"""Get the file and check for exists."""
if not value:
return None
return None # pragma: no cover

internal_url = utils.url_to_internal_value(urlparse(value).path)

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ omit = [
exclude_also = [
"def __repr__",
"def __str__",
"pass",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
Expand Down

0 comments on commit 65315cf

Please sign in to comment.