Changeset 1587

Show
Ignore:
Timestamp:
05/24/08 11:38:27 (22 months ago)
Author:
JensDiemer
Message:

update for new preferences changes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid/tests/unique_shortcuts.py

    r1476 r1587  
    2020import tests 
    2121 
    22 from PyLucid.models import Page, Preference 
     22from PyLucid.models import Page, Plugin 
    2323 
    2424class Shortcuttest(tests.TestCase): 
     
    2727    """ 
    2828    def setUp(self): 
    29         """ Ensure that auto_shortcuts is false. """ 
    30         auto_shortcuts = Preference.objects.get(name='auto shortcuts') 
    31         auto_shortcuts.value = False 
    32         auto_shortcuts.save() 
     29        """ Ensure that auto_shortcuts is false. """       
     30        plugin = Plugin.objects.get(plugin_name = "system_settings") 
     31        preferences = plugin.get_preferences() 
     32        preferences["auto_shortcuts"] = False 
     33        plugin.set_pref_data_string(preferences) 
     34        plugin.save() 
    3335 
    3436        self.page = Page.objects.all()[0] 
     
    7981        # http://www.djangoproject.com/documentation/db-api/#how-django-knows-to-update-vs-insert 
    8082        self.page.id = None # django recognizes page as new 
    81         self.page.shortcut = new_shortcut         
     83        self.page.shortcut = new_shortcut 
    8284        self.page.save() 
    8385        self.failUnlessEqual(self.page.shortcut,new_shortcut+"1") 
    8486 
    85         self.page.id = None  
    86         self.page.shortcut = new_shortcut         
     87        self.page.id = None 
     88        self.page.shortcut = new_shortcut 
    8789        self.page.save() 
    8890        self.failUnlessEqual(self.page.shortcut,new_shortcut+"2")