The following test code fails because in view_report, request.user is a SimpleLazyObject. How to I prepare the calling client properly to test my views?
class Test_views(TestCase):
def test_case(self):
c = Client()
c.login(username=username,password='password')
url = reverse('coach:view_report', kwargs={'report_id':13})
c.get(url,follow=True)
def view_report(request, report_id):
current_user = Coach.objects.get(id=request.user.id)