From b2026089edd81e886b4bf09ce9fe857fe9185af9 Mon Sep 17 00:00:00 2001 From: Christian Kreuzberger Date: Mon, 13 Mar 2017 21:27:08 +0100 Subject: [PATCH] Tests: added python 2.7 fallback for mock --- tests/test.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test.py b/tests/test.py index 81b539e..bcd1186 100644 --- a/tests/test.py +++ b/tests/test.py @@ -4,7 +4,11 @@ from rest_framework import status from rest_framework.test import APITestCase from django_rest_multitokenauth.models import MultiToken -from unittest.mock import patch +try: + from unittest.mock import patch +except: + # Python 2.7 fallback + from mock import patch # try getting reverse from django.urls try: