Commit 883563d8 by vagrant Committed by Diana Huang

Test max_calls == 0

parent a5d1cb35
......@@ -173,3 +173,14 @@ class FindUsersTests(unittest.TestCase):
[i % 2 == 0 for i in xrange(9)])
self.assertEqual(users[9].linkedin.has_linkedin_account, None)
self.assertTrue(command.stderr.getvalue().startswith("WARNING"))
@mock.patch('linkedin.management.commands.findusers.get_call_limits')
def test_command_no_api_calls(self, get_call_limits):
"""
Test rechecking all users with no API limits.
"""
from django.core.management.base import CommandError
fut = findusers.Command().handle
get_call_limits.return_value = (0, 0, 0)
with self.assertRaises(CommandError):
fut(recheck=True)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment