Changeset 1587
- Timestamp:
- 05/24/08 11:38:27 (22 months ago)
- Files:
-
- 1 modified
-
trunk/pylucid/tests/unique_shortcuts.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid/tests/unique_shortcuts.py
r1476 r1587 20 20 import tests 21 21 22 from PyLucid.models import Page, P reference22 from PyLucid.models import Page, Plugin 23 23 24 24 class Shortcuttest(tests.TestCase): … … 27 27 """ 28 28 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() 33 35 34 36 self.page = Page.objects.all()[0] … … 79 81 # http://www.djangoproject.com/documentation/db-api/#how-django-knows-to-update-vs-insert 80 82 self.page.id = None # django recognizes page as new 81 self.page.shortcut = new_shortcut 83 self.page.shortcut = new_shortcut 82 84 self.page.save() 83 85 self.failUnlessEqual(self.page.shortcut,new_shortcut+"1") 84 86 85 self.page.id = None 86 self.page.shortcut = new_shortcut 87 self.page.id = None 88 self.page.shortcut = new_shortcut 87 89 self.page.save() 88 90 self.failUnlessEqual(self.page.shortcut,new_shortcut+"2")