Permalink
Browse files

Fixing issue 9

  • Loading branch information...
1 parent 6b03a40 commit a90ed21be230050b730c701544767588dbb02e8b @coleifer coleifer committed Nov 11, 2010
Showing with 7 additions and 2 deletions.
  1. +0 −2 oembed/fields.py
  2. +7 −0 oembed/tests/tests/models.py
View
@@ -84,8 +84,6 @@ def handle_save_embeds(sender, instance, **kwargs):
for field in instance._meta.fields:
if isinstance(field, TextField):
urls.extend(re.findall(URL_RE, getattr(instance, field.name)))
-
- if not urls: return
urls = set(urls)
for embedded_field in embedded_media_fields:
@@ -83,6 +83,13 @@ def test_media_aggregation(self):
self.assertQuerysetEqual(r.videos.all(), [])
self.assertQuerysetEqual(r.photos.all(), am_queryset.filter(url=self.flickr_url))
+ r.content = 'Just text please'
+ r.save()
+
+ self.assertQuerysetEqual(r.media.all(), [])
+ self.assertQuerysetEqual(r.videos.all(), [])
+ self.assertQuerysetEqual(r.photos.all(), [])
+
def test_internal_media_aggregation(self):
category1 = Category.objects.get(pk=1)

0 comments on commit a90ed21

Please sign in to comment.