~ubuntu-branches/ubuntu/precise/maas/precise

« back to all changes in this revision

Viewing changes to src/maasserver/tests/test_commands.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-04-17 23:44:46 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20120417234446-y3212quny2x1gft8
Tags: 0.1+bzr482+dfsg-0ubuntu1
* New upstream release (Fixes LP: #981103)
* debian/maas.postinst:
  - Make sure rabbitmq and postgresql are started on upgrade (LP: #981282)
  - Handle upgrades from any lower than 0.1+bzr462+dfsg-0ubuntu1 to
    correctly re-generate passwords, and not have db sync/migrate issues
    as config has changed upstream.
  - Correctly set Passwords for PSERV, otherwise it won't set new passwords.
* Allow MAAS_DEFAULT_URL reconfiguration. (LP: #980970)
  - debian/maas.config: Add reconfigure validation to correctly allow it,
    and ask a question.
  - debian/maas.postinst: Reconfigure DEFAULT_MAAS_URL as well as cobbler
    server and next_server for PXE/Provisioning.
  - debian/maas.templates: Add debconf question and update info.
* Do not lose MAAS_DEFAULT_URL settings on upgrade (LP: #984309)
* debian/maas.postinst:
  - Set cobbler password in between quotes (LP: #984427)
  - Do not change permissions to maas.log (LP: #980915)
* no longer use maas-cloudimg2ephemeral, but rather use premade images 
  at http://maas.ubuntu.com

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
"""Test custom commands, as found in src/maasserver/management/commands."""
5
5
 
6
6
from __future__ import (
 
7
    absolute_import,
7
8
    print_function,
8
9
    unicode_literals,
9
10
    )
17
18
 
18
19
from django.conf import settings
19
20
from django.contrib.auth.models import User
 
21
from django.core.cache import cache
20
22
from django.core.management import call_command
21
23
from maasserver.models import FileStorage
22
24
from maasserver.testing.factory import factory
101
103
        self.assertTrue(users[0].check_password(password))
102
104
        self.assertTrue(users[0].is_superuser)
103
105
        self.assertEqual(email, users[0].email)
 
106
 
 
107
    def test_clearcache_clears_entire_cache(self):
 
108
        key = factory.getRandomString()
 
109
        cache.set(key, factory.getRandomString())
 
110
        call_command('clearcache')
 
111
        self.assertIsNone(cache.get(key, None))
 
112
 
 
113
    def test_clearcache_clears_specific_key(self):
 
114
        key = factory.getRandomString()
 
115
        cache.set(key, factory.getRandomString())
 
116
        another_key = factory.getRandomString()
 
117
        cache.set(another_key, factory.getRandomString())
 
118
        call_command('clearcache', key=key)
 
119
        self.assertIsNone(cache.get(key, None))
 
120
        self.assertIsNotNone(cache.get(another_key, None))