Beispiel #1
0
 def __init__(self, category):
     c = NubeCategory()
     c.id(category.nube_id)
     c.name('es', category.name)
     c.description('es', category.name)  # TODO agregar descripcion aca!!!
     c.parent(category.parent.nube_id)
     self._p = c
Beispiel #2
0
 def test_seo_title(self):
     v = NubeCategory()
     v.seo_title('en', 'seo title ------- ')
     v.seo_title('en', 'seo title')
     v.seo_title('es', 'seo titulo')
     self.assertDictEqual(
         v.get_dict(),
         {'seo_title': {
             'es': 'seo titulo',
             'en': 'seo title'
         }})
Beispiel #3
0
 def test_handle(self):
     v = NubeCategory()
     v.handle('es', 'esta-es-el-handle --------- ')
     v.handle('es', 'esta-es-el-handle')
     self.assertDictEqual(v.get_dict(),
                          {'handle': {
                              'es': 'esta-es-el-handle'
                          }})
Beispiel #4
0
 def test_description(self):
     v = NubeCategory()
     v.description('es', 'esta es la descripción ---- ')
     v.description('es', 'esta es la descripción')
     self.assertDictEqual(v.get_dict(),
                          {'description': {
                              'es': 'esta es la descripción'
                          }})
Beispiel #5
0
 def test_name(self):
     v = NubeCategory()
     v.name('es', 'este es el nombre ----')
     v.name('es', 'Cuidados de la piel')
     self.assertDictEqual(v.get_dict(),
                          {'name': {
                              'es': 'Cuidados de la piel'
                          }})
Beispiel #6
0
 def test_seo_description(self):
     v = NubeCategory()
     v.seo_description('es', 'seo descripción ---- ')
     v.seo_description('es', 'seo descripción')
     v.seo_description('en', 'seo description')
     self.assertDictEqual(v.get_dict(), {
         'seo_description': {
             'es': 'seo descripción',
             'en': 'seo description'
         }
     })
Beispiel #7
0
 def test_subcategories(self):
     v = NubeCategory()
     v.subcategories([1, 2, 3])
     self.assertDictEqual(v.get_dict(), {'subcategories': [1, 2, 3]})
Beispiel #8
0
 def test_parent2(self):
     v = NubeCategory()
     v.parent(False)
     self.assertDictEqual(v.get_dict(), {'parent': None})
Beispiel #9
0
 def test_parent(self):
     v = NubeCategory()
     v.parent(123)
     self.assertDictEqual(v.get_dict(), {'parent': 123})
Beispiel #10
0
 def test_id1(self):
     v = NubeCategory()
     v.id(False)
     self.assertDictEqual(v.get_dict(), {})
Beispiel #11
0
 def test_id(self):
     v = NubeCategory()
     v.id(123456)
     self.assertDictEqual(v.get_dict(), {'id': 123456})