mailchimp ops now example.org aware, test users, now all changed to example.org

pull/1/head
eric 2013-03-06 09:39:06 -05:00
parent cc6a9b1200
commit d6a8dedfaa
4 changed files with 18 additions and 14 deletions

View File

@ -22,7 +22,7 @@ class ApiTests(TestCase):
deadline=now(),
target=Decimal('1000.00'),
)
self.user = User.objects.create_user('test', 'test@example.com', 'testpass')
self.user = User.objects.create_user('test', 'test@example.org', 'testpass')
self.client = Client()
def test_user(self):

View File

@ -1116,7 +1116,11 @@ class UserProfile(models.Model):
return False
def ml_subscribe(self, **kwargs):
if "@example.org" in self.user.email:
# use @example.org email addresses for testing!
return True
try:
if not self.on_ml():
return pm.listSubscribe(id=settings.MAILCHIMP_NEWS_ID, email_address=self.user.email, **kwargs)
except Exception, e:
logger.error("error subscribing to mailchimp list %s" % (e))

View File

@ -179,10 +179,10 @@ class BookLoaderTests(TestCase):
self.assertEqual(models.Work.objects.count(), 2)
# add the stub works to a wishlist
user = User.objects.create_user('test', 'test@example.com', 'testpass')
user = User.objects.create_user('test', 'test@example.org', 'testpass')
user.wishlist.add_work(e1.work, 'test')
user.wishlist.add_work(e2.work, 'test')
manager = User.objects.create_user('manager', 'manager@example.com', 'managerpass')
manager = User.objects.create_user('manager', 'manager@example.org', 'managerpass')
# create campaigns for the stub works
c1 = models.Campaign.objects.create(
name=e1.work.title,
@ -390,7 +390,7 @@ class CampaignTests(TestCase):
def test_campaign_status(self):
# need a user to associate with a transaction
user = User.objects.create_user('test', 'test@example.com', 'testpass')
user = User.objects.create_user('test', 'test@example.org', 'testpass')
w = Work()
w.save()
@ -404,7 +404,7 @@ class CampaignTests(TestCase):
c2 = Campaign(target=D('1000.00'),deadline=datetime(2013,1,1),work=w)
c2.save()
self.assertEqual(c2.status, 'INITIALIZED')
u = User.objects.create_user('claimer', 'claimer@example.com', 'claimer')
u = User.objects.create_user('claimer', 'claimer@example.org', 'claimer')
u.save()
rh = RightsHolder(owner = u, rights_holder_name = 'rights holder name')
rh.save()
@ -486,7 +486,7 @@ class WishlistTest(TestCase):
def test_add_remove(self):
# add a work to a user's wishlist
user = User.objects.create_user('test', 'test@example.com', 'testpass')
user = User.objects.create_user('test', 'test@example.org', 'testpass')
edition = bookloader.add_by_isbn('0441007465')
work = edition.work
num_wishes=work.num_wishes
@ -643,7 +643,7 @@ class DownloadPageTest(TestCase):
e2.save()
eb1 = models.Ebook()
eb1.url = "http://example.com"
eb1.url = "http://example.org"
eb1.edition = e1
eb1.format = 'epub'
@ -657,7 +657,7 @@ class DownloadPageTest(TestCase):
anon_client = Client()
response = anon_client.get("/work/%s/download/" % w.id)
self.assertContains(response, "http://example.com", count=4)
self.assertContains(response, "http://example.org", count=4)
self.assertContains(response, "http://example2.com", count=3)

View File

@ -306,8 +306,8 @@ class CreditTest(TestCase):
def setUp(self):
"""
"""
self.user1 = User.objects.create_user('credit_test1', 'support@gluejar.com', 'credit_test1')
self.user2 = User.objects.create_user('credit_test2', 'support+1@gluejar.com', 'credit_test2')
self.user1 = User.objects.create_user('credit_test1', 'support@example.org', 'credit_test1')
self.user2 = User.objects.create_user('credit_test2', 'support+1@example.org', 'credit_test2')
def testSimple(self):
"""
@ -333,7 +333,7 @@ class TransactionTest(TestCase):
create a single transaction with PAYMENT_TYPE_AUTHORIZATION / ACTIVE with a $12.34 pledge and see whether the payment
manager can query and get the right amount.
"""
user = User.objects.create_user('payment_test', 'support@gluejar.com', 'payment_test')
user = User.objects.create_user('payment_test', 'support@example.org', 'payment_test')
w = Work()
w.save()
@ -389,9 +389,9 @@ class AccountTest(TestCase):
def setUp(self):
# create a user
self.user1 = User.objects.create_user('account_test1', 'account_test1@gluejar.com', 'account_test1_pw')
self.user1 = User.objects.create_user('account_test1', 'account_test1@example.org', 'account_test1_pw')
self.user1.save()
self.user2 = User.objects.create_user('account_test2', 'account_test2@gluejar.com', 'account_test2_pw')
self.user2 = User.objects.create_user('account_test2', 'account_test2@example.org', 'account_test2_pw')
self.user2.save()
self.account1 = Account(host='host1', account_id='1', user=self.user1)
self.account1.save()