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
| # we also index a keyword version of the field | |
| name = Text( | |
| analyzer=my_custom_analyzer, | |
| fields={'keyword': es.Keyword()} | |
| ) | |
| # and use it with facets like this | |
| 'city': TermsFacet(field='user.city.name.keyword'), |
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
| tests/views/test_project_detail_view.py | |
| tests/views/..... | |
| >> Views must ONLY test input and status code of the response. Mock the business logic to test the status code. | |
| Ideally our views should be very SLIM and all the logic must go in services and helper functions | |
| If we need to access some variables from request in the service, then better destructure it in the view and pass ONLY the variable in the service NEVER the request object. | |
| In case of API view, call the service from the serializer after validating the input. Don't come back to the view with the validated input and then put the input again in the service. | |
| tests/services/test_document_service.py |
OlderNewer