-
Notifications
You must be signed in to change notification settings - Fork 2
First pass at increasing test coverage #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e2bbbc8
add tests for TEKDB/context_processors
paigewilliams 91208c9
add tests for explore/context_processors.py
paigewilliams 7aace23
add tests for TEKDB/admin.py
paigewilliams 394cee8
exclude tests from coverage
paigewilliams 229c81a
add more tests for models.py
paigewilliams 1d924d7
add tests for explore/views
paigewilliams 273dc85
add more tests for explore/views
paigewilliams 95dd766
add tests for TEKDB/views
paigewilliams 1c0f0dc
fix typos and test assertions
paigewilliams File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| [run] | ||
| omit = | ||
| */migrations/* | ||
| */migrations/* | ||
| */tests/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,6 +104,10 @@ def __init__(self, *args, **kwargs): | |
|
|
||
|
|
||
| class CitationsForm(forms.ModelForm): | ||
| class Meta: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was getting an error with |
||
| model = Citations | ||
| fields = "__all__" | ||
|
|
||
| def __init__(self, *args, **kwargs): | ||
| super(CitationsForm, self).__init__(*args, **kwargs) | ||
| self.fields["referencetype"].queryset = LookupReferenceType.objects.order_by( | ||
|
|
@@ -138,6 +142,10 @@ class Meta: | |
|
|
||
|
|
||
| class ResourcesForm(forms.ModelForm): | ||
| class Meta: | ||
| model = Resources | ||
| fields = "__all__" | ||
|
|
||
| def __init__(self, *args, **kwargs): | ||
| super(ResourcesForm, self).__init__(*args, **kwargs) | ||
| self.fields[ | ||
|
|
@@ -632,7 +640,6 @@ def save_model(self, request, obj, form, change): | |
| mediatype__startswith="other" | ||
| ).first() | ||
| mediatype = media_type_instance | ||
|
|
||
| filename = file.name.split(".")[0] | ||
|
|
||
| media_instance = Media( | ||
|
|
@@ -965,10 +972,10 @@ class PlacesAdmin(NestedRecordAdminProxy, RecordModelAdmin): | |
| change_list_template = "admin/TEKDB/places/change_list.html" | ||
|
|
||
| def changelist_view(self, request, extra_context=None): | ||
| from .views import getPlacesGeoJSON | ||
| from .views import get_places_geojson | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I renamed the function to snake case instead of camel case to follow convention. |
||
|
|
||
| extra_context = extra_context or {} | ||
| extra_context["results_geojson"] = getPlacesGeoJSON(request) | ||
| extra_context["results_geojson"] = get_places_geojson(request) | ||
| return super(PlacesAdmin, self).changelist_view( | ||
| request, extra_context=extra_context | ||
| ) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing tests from coverage stats