incuna / incuna-test-utils

TestCases and other helpers for testing Django apps.
BSD 2-Clause "Simplified" License
7 stars 7 forks source link

Add `call-view` property to BaseRequestTestCase #57

Closed LilyFoote closed 5 years ago

meshy commented 9 years ago

Seems odd to me that this is a property. How were you expecting this to be used?

LilyFoote commented 9 years ago

self.call_view(request)

I could do:

def call_view(self, *args, **kwargs):
    return self.get_view()(*args, **kwargs)

but that's harder to test.

meshy commented 9 years ago

I don't see the benefit of this either way.

LilyFoote commented 9 years ago

It's DRYer tests. I often see something like:

view = self.view.as_view()
response = view(request)

This would become:

response = self.call_view(request)
meshy commented 9 years ago

¯\_(ツ)_/¯

LilyFoote commented 5 years ago

Not worth it.