Commits

Mike Crute  committed d268230 Merge

Merging changes for tickets 238-241

  • Participants
  • Parent commits e378a3b, 226040e

Comments (0)

Files changed (4)

File tests/__init__.py

                 raise
 
         suites = [DocTestSuite(mod, extraglobs={'app': app})]
-        filename = modname[10:] + '.txt'
+        filename = modname[5:] + '.txt'
         if filename in test_files:
             globs = {'app': app}
             globs.update(mod.__dict__)

File tests/config.txt

 Are those changes written to the config file correctly?
 	
 	>>> app.cfg.change_single('pings_enabled', False)
-	True
 	>>> [line for line in open(app.cfg.filename) if 'pings_enabled' in line][0]
 	'pings_enabled = False\n'
 

File zine/config.py

         if key in self._converted_values:
             return self._converted_values[key]
         elif key in self._remove:
-            return self.cfg.config_vars[key][1]
+            return self.cfg.config_vars[key].get_default()
         return self.cfg[key]
 
     def __setitem__(self, key, value):
         if isinstance(value, str):
             value = value.decode('utf-8')
         field = self.cfg.config_vars[key]
+
+        if value == field.get_default():
+            self.revert_to_default(key)
+            return
+
         self._values[key] = field.to_primitive(value)
         self._converted_values[key] = value
 

File zine/utils/zeml.py

         The tail text for the outer element.  To understand this, look at the
         following example:
 
-        >>> root = parse_zeml("1 <b>2</b> 3")
+        >>> root = parse_zeml("1 <b>2</b> 3", 'system')
         >>> root.text
         u'1 '
         >>> root.children[0].text