Esempio n. 1
0
    def test_migration_removes_targets(self):
        project = ProjectFactory(creator=self.user1)

        project.add_addon('box', auth=Auth(self.user1))
        node_addon = project.get_addon('box')
        node_addon.foreign_user_settings = self.user1_settings
        node_addon.save()

        assert_equal(get_targets().count(), 1)

        do_migration([self.user1_settings])
        self.user1_settings.reload()

        assert_equal(get_targets().count(), 0)
 def test_get_targets(self):
     self.user2 = UserFactory()
     self.user2_settings = BoxUserSettingsFactory(owner=self.user2)
     self.user2_settings.oauth_settings = None
     self.user2_settings.save()
     addons = [self.user2_settings, self.user1_settings]
     for addon in addons:
         addon.save()
     targets = get_targets()
     assert_equal(targets.count(), 1)
     assert_equal(targets[0]._id, addons[-1]._id)
Esempio n. 3
0
 def test_get_targets(self):
     self.user2 = UserFactory()
     self.user2_settings = BoxUserSettingsFactory(owner=self.user2)
     self.user2_settings.oauth_settings = None
     self.user2_settings.save()
     addons = [
         self.user2_settings,
         self.user1_settings,
     ]
     for addon in addons:
         addon.save()
     targets = get_targets()
     assert_equal(targets.count(), 1)
     assert_equal(targets[0]._id, addons[-1]._id)