rohit-clootrack / linting-test

Assert statement used outside of tests BAN-B101
Security
Major
a year agoa year old
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
25    success_message = _("Information successfully updated")
26
27    def get_success_url(self):
28        assert (29            self.request.user.is_authenticated30        )  # for mypy to know that the user is authenticated31        return self.request.user.get_absolute_url()
32
33    def get_object(self):
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
60    with open(output_file_path) as output_file:
61        actual_output_file_content = output_file.read()
62
63    assert actual_output_file_content == expected_output_file_content64
65
66if __name__ == "__main__":
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
16    lookup_field = "username"
17
18    def get_queryset(self, *args, **kwargs):
19        assert isinstance(self.request.user.id, int)20        return self.queryset.filter(id=self.request.user.id)
21
22    @action(detail=False)