From 95b86434ffe3ee0785470c01221ebca3b385abdf Mon Sep 17 00:00:00 2001 From: Daniel Roschka Date: Sun, 29 Mar 2015 19:03:53 +0200 Subject: [PATCH] Fixes outstanding failing tests Fixes three failing tests. For test_ipinfo_ResolutionFail it fixes the following issues: * failing when no network is available * failing when Google changes the ip addresses of the service * failing when the order of returned ip addresses is different For test_DeleteRecordInitial_Empty and test_DeleteRecordInitial it fixes a not existing BindServer object. --- binder/tests/testHelpers.py | 7 +++---- binder/tests/testViews.py | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/binder/tests/testHelpers.py b/binder/tests/testHelpers.py index 6bb011a..9553123 100644 --- a/binder/tests/testHelpers.py +++ b/binder/tests/testHelpers.py @@ -7,7 +7,6 @@ class HelperTests(TestCase): response = helpers.ip_info("foobar.doesnotexist.local") self.assertEqual([['Error', u'Unable to resolve foobar.doesnotexist.local: [Errno -2] Name or service not known']], response) - response = helpers.ip_info("time1.google.com") - self.assertEqual([['IPv4 (1)', u'216.239.32.15'], ['IPv6 (1)', u'2001:4860:4802:32::f']], - response) - + response = helpers.ip_info("localhost") + self.assertEqual([['IPv4 (1)', u'127.0.0.1'], ['IPv6 (1)', u'::1']], + sorted(response)) diff --git a/binder/tests/testViews.py b/binder/tests/testViews.py index 4954f35..a480823 100644 --- a/binder/tests/testViews.py +++ b/binder/tests/testViews.py @@ -44,6 +44,9 @@ class PostTests(TestCase): """ Unit Tests that exercise HTTP POST. """ def setUp(self): self.client = Client() + models.BindServer(hostname="testserver.test.net", + statistics_port=1234).save() + def test_DeleteRecordInitial_Empty(self): """ Ensure the initial deletion form works as expected with no RR list. """