Commits

Peter Sanchez committed c7e7050

Updated tests to match new verification. All tests pass now.

Comments (0)

Files changed (1)

djpubsubhubbub/tests.py

 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 import urllib2
+import urlparse
 
 from datetime import datetime, timedelta
 
             Subscription.objects.filter(
                 hub='http://myhub.example.com/endpoint',
                 topic='http://publisher.example.com/happycats.xml',
-                verified=True).count(), 1)
+            ).count(), 1)
         self.assertEquals(len(self.requests), 1)
         self.assertEquals(self.requests[0][0],
                           'http://myhub.example.com/endpoint')
-        self.assertEquals(self.requests[0][1]['callback'],
-                          'http://testserver/1/')
+        callback_url = urlparse.urljoin(
+            'http://testserver',
+            reverse('pubsubhubbub_callback', args=(sub.pk,)),
+        )
+        self.assertEquals(self.requests[0][1]['callback'], callback_url)
         self.assert_((self.requests[0][1]['lease_seconds'] - 86400) < 5)
 
     def test_update_with_changed_self(self):
             Subscription.objects.filter(
                 hub='http://myhub.example.com/endpoint',
                 topic='http://publisher.example.com/happycats.xml',
-                verified=True).count(), 1)
+            ).count(), 1)
         self.assertEquals(len(self.requests), 1)
         self.assertEquals(self.requests[0][0],
                           'http://myhub.example.com/endpoint')
-        self.assertEquals(self.requests[0][1]['callback'],
-                          'http://testserver/1/')
+        callback_url = urlparse.urljoin(
+            'http://testserver',
+            reverse('pubsubhubbub_callback', args=(sub.pk,)),
+        )
+        self.assertEquals(self.requests[0][1]['callback'], callback_url)
         self.assert_((self.requests[0][1]['lease_seconds'] - 86400) < 5)
 
     def test_update_with_changed_hub_and_self(self):
             Subscription.objects.filter(
                 hub='http://myhub.example.com/endpoint',
                 topic='http://publisher.example.com/happycats.xml',
-                verified=True).count(), 1)
+            ).count(), 1)
         self.assertEquals(len(self.requests), 1)
         self.assertEquals(self.requests[0][0],
                           'http://myhub.example.com/endpoint')
-        self.assertEquals(self.requests[0][1]['callback'],
-                          'http://testserver/1/')
+        callback_url = urlparse.urljoin(
+            'http://testserver',
+            reverse('pubsubhubbub_callback', args=(sub.pk,)),
+        )
+        self.assertEquals(self.requests[0][1]['callback'], callback_url)
         self.assert_((self.requests[0][1]['lease_seconds'] - 86400) < 5)