This repository has been archived by the owner on Feb 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release branch for 0.8.x releases (#158)
* cherry-pick contribution email. * add amount paid back to email * styled this * style fix * last style * email * last one * last one part two * fix deadline * add bcc * 0.8.15 * add bulbs/instant_articles * add bulbs/ads * just the stuff we like * tests * working business * bump * Merge pull request #173 from theonion/glance-json-feed Glance json feed * Merge pull request #174 from theonion/glance-feed-tweaks Glance feed tweaks * Wrapped footer in block so it can be overridden for individual properties * Fixed issue with targeting not coming through in ads or analytics * Default sort should be last modified, than published * Bump version 0.8.17 * Bump version to 0.8.18 * Version bump * fix some tests * fix more tests * changelog update
- Loading branch information
Showing
10 changed files
with
147 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "1.1.1" | ||
__version__ = "2.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
from django.contrib.auth import get_user_model | ||
from django.core.urlresolvers import reverse | ||
from django.template.defaultfilters import slugify | ||
from django.test.client import Client | ||
from django.test.utils import override_settings | ||
|
||
from bulbs.content.models import FeatureType | ||
from bulbs.utils.test import make_content, BaseIndexableTestCase | ||
|
||
from example.testcontent.models import TestContentObj | ||
|
||
|
||
DFP_SITE = "www.google.com" | ||
|
||
|
||
class InstantArticleAdViewTests(BaseIndexableTestCase): | ||
def setUp(self): | ||
super(InstantArticleAdViewTests, self).setUp() | ||
|
@@ -15,11 +21,21 @@ def setUp(self): | |
self.content = make_content(TestContentObj, feature_type=self.feature_type) | ||
self.url = reverse("instant_article_ad", kwargs={"pk": self.content.pk}) | ||
|
||
User = get_user_model() | ||
admin = self.admin = User.objects.create_user("admin", "[email protected]", "secret") | ||
admin.is_staff = True | ||
admin.save() | ||
|
||
@override_settings(DFP_SITE=DFP_SITE) | ||
def test_ad_unit(self): | ||
self.client.login(username="admin", password="secret") | ||
|
||
response = self.client.get(self.url) | ||
targeting = response.context_data.get("targeting") | ||
|
||
self.assertEqual(response.status_code, 200) | ||
# TODO: bubble up ad formatting. | ||
# self.assertInHTML( | ||
# '<div class="dfp dfp-slot-instant-article-inread" data-ad-unit="instant-article-inread" >', | ||
# str(response.content) | ||
# ) | ||
self.assertEqual(DFP_SITE, targeting.get("dfp_site")) | ||
self.assertEqual(slugify(self.feature_type), targeting.get("dfp_feature")) | ||
self.assertEqual(self.content.id, targeting.get("dfp_contentid")) | ||
self.assertEqual(self.content.__class__.__name__.lower(), targeting.get("dfp_pagetype")) | ||
self.assertEqual(self.content.slug, targeting.get("dfp_slug")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
from django.contrib.auth import get_user_model | ||
from django.core.urlresolvers import reverse | ||
from django.template.defaultfilters import slugify | ||
from django.test.client import Client | ||
from django.test.utils import override_settings | ||
|
||
from bulbs.content.models import FeatureType | ||
from bulbs.utils.test import make_content, BaseIndexableTestCase | ||
|
||
from example.testcontent.models import TestContentObj | ||
|
||
|
||
DFP_SITE = "www.google.com" | ||
|
||
|
||
class AnalyticsViewTests(BaseIndexableTestCase): | ||
|
||
def setUp(self): | ||
|
@@ -15,10 +21,24 @@ def setUp(self): | |
name="Ey go that way bruh", instant_article=True | ||
) | ||
self.content = make_content(TestContentObj, feature_type=self.feature_type) | ||
User = get_user_model() | ||
admin = self.admin = User.objects.create_user("admin", "[email protected]", "secret") | ||
admin.is_staff = True | ||
admin.save() | ||
|
||
@override_settings(DFP_SITE=DFP_SITE) | ||
def test_analytics(self): | ||
self.client = Client() | ||
self.client.login(username="admin", password="secret") | ||
url = reverse("instant_article_analytics", kwargs={"pk": self.content.pk}) | ||
|
||
response = self.client.get(url) | ||
targeting = response.context_data.get("targeting") | ||
|
||
self.assertEqual(response.status_code, 200) | ||
self.assertEqual("Instant Articles", response.context_data.get("platform")) | ||
self.assertEqual(DFP_SITE, targeting.get("dfp_site")) | ||
self.assertEqual(slugify(self.feature_type), targeting.get("dfp_feature")) | ||
self.assertEqual(self.content.id, targeting.get("dfp_contentid")) | ||
self.assertEqual(self.content.__class__.__name__.lower(), targeting.get("dfp_pagetype")) | ||
self.assertEqual(self.content.slug, targeting.get("dfp_slug")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from django.contrib.auth import get_user_model | ||
from django.core.urlresolvers import reverse | ||
from django.template.defaultfilters import slugify | ||
from django.test.client import Client | ||
from django.test.utils import override_settings | ||
|
||
from bulbs.content.models import FeatureType | ||
from bulbs.utils.test import make_content, BaseIndexableTestCase | ||
|
||
from example.testcontent.models import TestContentObj | ||
|
||
|
||
DFP_SITE = "www.google.com" | ||
|
||
|
||
class InstantArticleAdViewTests(BaseIndexableTestCase): | ||
def setUp(self): | ||
super(InstantArticleAdViewTests, self).setUp() | ||
self.client = Client() | ||
self.feature_type = FeatureType.objects.create(name="AdBoys", instant_article=True) | ||
self.content = make_content(TestContentObj, feature_type=self.feature_type) | ||
self.url = reverse("instant_article", kwargs={"pk": self.content.pk}) | ||
|
||
User = get_user_model() | ||
admin = self.admin = User.objects.create_user("admin", "[email protected]", "secret") | ||
admin.is_staff = True | ||
admin.save() | ||
|
||
@override_settings(DFP_SITE=DFP_SITE) | ||
def test_ad_unit(self): | ||
self.client.login(username="admin", password="secret") | ||
|
||
response = self.client.get(self.url) | ||
targeting = response.context_data.get("targeting") | ||
|
||
self.assertEqual(response.status_code, 200) | ||
self.assertEqual(DFP_SITE, targeting.get("dfp_site")) | ||
self.assertEqual(slugify(self.feature_type), targeting.get("dfp_feature")) | ||
self.assertEqual(self.content.id, targeting.get("dfp_contentid")) | ||
self.assertEqual(self.content.__class__.__name__.lower(), targeting.get("dfp_pagetype")) | ||
self.assertEqual(self.content.slug, targeting.get("dfp_slug")) |