Example #1
0
 def test_update(self):
     delicious.update()
     
     # Check that the calls to the API match what we expect
     FakeClient.assert_called_with(settings.DELICIOUS_USERNAME, settings.DELICIOUS_PASSWORD)
     FakeClient.posts.update.assert_called_with()
     FakeClient.posts.dates.assert_called_with()
     FakeClient.posts.get.assert_called_with(dt='2009-08-18')
     
     # Check that the bookmark exists
     b = Bookmark.objects.get(url="http://jacobian.org/")
     self.assertEqual(b.description, "Me!")
     
     # Check that the Item exists
     i = Item.objects.get(content_type__model='bookmark', object_id=b.pk)
     self.assertEqual(i.timestamp.date(), datetime.date(2009, 8, 18))
     self.assertEqual(i.tags, 'me jacob jacobian')
Example #2
0
    def test_update(self):
        delicious.update()

        # Check that the calls to the API match what we expect
        FakeClient.assert_called_with(settings.DELICIOUS_USERNAME,
                                      settings.DELICIOUS_PASSWORD)
        FakeClient.posts.update.assert_called_with()
        FakeClient.posts.dates.assert_called_with()
        FakeClient.posts.get.assert_called_with(dt='2009-08-18')

        # Check that the bookmark exists
        b = Bookmark.objects.get(url="http://jacobian.org/")
        self.assertEqual(b.description, "Me!")

        # Check that the Item exists
        i = Item.objects.get(content_type__model='bookmark', object_id=b.pk)
        self.assertEqual(i.timestamp.date(), datetime.date(2009, 8, 18))
        self.assertEqual(i.tags, 'me jacob jacobian')
Example #3
0
 def test_update_skipped_second_time(self, mocked):
     delicious.update()
     delicious.update()
     self.assert_(mocked.info.called)
Example #4
0
 def test_update_skipped_second_time(self, mocked):
     delicious.update()
     delicious.update()
     self.assert_(mocked.info.called)