1. Ed Crewe
  2. ilrt.contentmigrator

Commits

Ed Crewe  committed 43bba2b

fix google tests and try to set html content

  • Participants
  • Parent commits 0a1e156
  • Branches default

Comments (0)

Files changed (3)

File ilrt/contentmigrator/exportimport/content.py

View file
                     if len(parts) > 1:
                         meta = parts[0]
                         meta = "[DEFAULT]\n%s" % parts[0]
-                        if hasattr(obj,'setText'):
-                            obj.setText(parts[1])
+                        if hasattr(obj, 'setText'):
+                            obj.setText(parts[1], mimetype='text/html')
                         else:
                             try:
                                 obj['text'] = parts[1]
                         self.out.append('Found no metadata for obj %s' % obj.getId())
                     self.put_props(obj, meta, import_context, subdir)
 
-        if getattr(self,'reindex','item') == 'item':
+        if getattr(self, 'reindex', 'item') == 'item':
             obj.indexObject()
 
         return obj
                         value = atconvert[typename](value)
                     mutator = f.getMutator(obj)
                     if mutator:
-                        mutator(value)
-                        written = True
+                        try:
+                            mutator(value)
+                            written = True
+                        except:
+                            written = False
                         #debug self.out.append(
                         #   'convert %s to %s and add with %s' % (invalue, value, mutator))
                 if not written:

File ilrt/contentmigrator/tests/export_google.txt

View file
 
     >>> client = gdata.sites.client.SitesClient(source=SOURCE, site=SITE)
     >>> client.ssl = True  
-    >>> client.ClientLogin(USER, PW, client.auth_service)
+    >>> token = client.ClientLogin(USER, PW, client.auth_service)
 
 Check we are pointing at the test site
 

File ilrt/contentmigrator/tests/import_google.txt

View file
     >>> PW = 'torrag456'
     >>> client = gdata.sites.client.SitesClient(source=SOURCE, site=SITE)
     >>> client.ssl = True  
-    >>> client.ClientLogin(USER, PW, client.auth_service)
+    >>> token = client.ClientLogin(USER, PW, client.auth_service)
 
 Check we are pointing at the test site