Ejemplo n.º 1
0
    def test_refresh_works(self):
        State.tenant_cache[1].anonymize_outgoing_connections = False

        yield set_latest_version('0.0.1')
        yield self.test_model_count(models.Mail, 0)

        def fetch_packages_file_mock(self):
            return succeed(packages)

        UpdateCheck.fetch_packages_file = fetch_packages_file_mock

        yield UpdateCheck().operation()

        latest_version = yield get_latest_version()
        self.assertEqual(latest_version, '2.0.1337')
        yield self.test_model_count(models.Mail, 1)
Ejemplo n.º 2
0
    def test_refresh_works(self):
        State.tenant_cache[1].anonymize_outgoing_connections = False

        yield tw(config.db_set_config_variable, 1, 'latest_version', __version__)
        yield self.test_model_count(models.Mail, 2)

        def fetch_packages_file_mock(self):
            return succeed(packages)

        UpdateCheck.fetch_packages_file = fetch_packages_file_mock

        yield UpdateCheck().operation()

        latest_version = yield tw(config.db_get_config_variable, 1, 'latest_version')
        self.assertEqual(latest_version, '6.6.6')
        yield self.test_model_count(models.Mail, 3)