Ejemplo n.º 1
0
  def test_get_salmon(self):
    # this one should be dropped
    without_link = copy.deepcopy(ACTIVITY_SALMON_VARS)
    without_link['in_reply_to'] = None

    GooglePlusService.call_with_creds('my gae user id', 'activities.list',
                                      userId='x', collection='public',
                                      maxResults=100)\
        .AndReturn({'items': [ACTIVITY_JSON, without_link]})

    GooglePlusService.call_with_creds('my gae user id', 'comments.list',
                                      activityId='123', maxResults=100)\
        .AndReturn({'items': [COMMENT_JSON]})

    self.mox.ReplayAll()

    self.googleplus.owner = models.User(key_name='my gae user id')
    self.assert_equals([ACTIVITY_SALMON_VARS, COMMENT_SALMON_VARS],
                       self.googleplus.get_salmon())