Commit d3d481ae by Piotr Mitros

Untested code paths still exists in multiembed, but basic tests pass

parent 420a2e62
...@@ -74,7 +74,7 @@ class multi_embed(): ...@@ -74,7 +74,7 @@ class multi_embed():
def __getattr__(self, attr): def __getattr__(self, attr):
for x in self._embeds: for x in self._embeds:
try: try:
attr = x.__getattr(attr) attr = x.__getattr__(attr)
except AttributeError: except AttributeError:
pass pass
if attr: if attr:
...@@ -173,7 +173,10 @@ class single_embed(object): ...@@ -173,7 +173,10 @@ class single_embed(object):
def __repr__(self): def __repr__(self):
''' Pretty representation of the object. ''' ''' Pretty representation of the object. '''
return self._view_or_query+" object host: ["+self._baseurl+"]" if self._baseurl:
return self._view_or_query+" object host: ["+self._baseurl+"]"
else:
return self._view_or_query+"/local"
class transform_embed(object): class transform_embed(object):
''' '''
...@@ -251,8 +254,9 @@ def get_embed(t): ...@@ -251,8 +254,9 @@ def get_embed(t):
except AttributeError: except AttributeError:
pass pass
if embed_config: # untested code path if embed_config: # untested code path
embeds = []
for embed_spec in embed_config: for embed_spec in embed_config:
single_embeds(t, embed_spec) embeds.append(single_embed(t, **embed_spec))
return multi_embed(embeds) return multi_embed(embeds)
return single_embed(t) return single_embed(t)
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
import datetime import datetime
DJOBJECT_CONFIG = [{}, {'baseurl' : 'http://127.0.0.1:9022/'}]
DJ_REQUIRED_APPS = ( 'djeventstream.httphandler', DJ_REQUIRED_APPS = ( 'djeventstream.httphandler',
'djcelery', 'djcelery',
'south', 'south',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment