def testAttributeSetting(self): c = get_contact_or_fake('test test', '*****@*****.**') results = update_subscription(c, True, attributes = {'var1' : 'True'}) sub = Subscription.objects.get(email='*****@*****.**') self.assert_(sub) self.assertEqual(sub.attribute_value('var1'), 'True') self.assertTrue(sub.subscribed)
def testNewIsSubscribed(self): url = urlresolvers.reverse("newsletter_subscribe_ajah") c = get_contact_or_fake("test test", "*****@*****.**") self.assertFalse(is_subscribed(c)) response = self.client.post(url, {"full_name": "Testy Testerson", "email": c.email}) self.assertTrue(is_subscribed(c))
def testSetReset(self): c = get_contact_or_fake('test test', '*****@*****.**') results = update_subscription(c, True) sub = is_subscribed(c) self.assertTrue(sub) results = update_subscription(c, False) sub = is_subscribed(c) self.assertFalse(sub)
def testSetReset(self): c = get_contact_or_fake("test test", "*****@*****.**") results = update_subscription(c, True) sub = is_subscribed(c) self.assertTrue(sub) results = update_subscription(c, False) sub = is_subscribed(c) self.assertFalse(sub)
def testNewIsSubscribed(self): url = urlresolvers.reverse('newsletter_subscribe_ajah') c = get_contact_or_fake('test test', '*****@*****.**') self.assertFalse(is_subscribed(c)) response = self.client.post(url, { 'full_name' : 'Testy Testerson', 'email': c.email, }) self.assertTrue(is_subscribed(c))
def get_contact(self): data = self.cleaned_data email = data['email'] full_name = data['full_name'] return get_contact_or_fake(full_name, email)
def testExplicitSubscribed(self): c = get_contact_or_fake('test test', '*****@*****.**') results = update_subscription(c, True) sub = is_subscribed(c) self.assertTrue(sub)
def testExplicitUnsubscribed(self): c = get_contact_or_fake('test test', '*****@*****.**') results = update_subscription(c, False) sub = is_subscribed(c) self.assertFalse(sub)
def testNewIsUnsubscribed(self): c = get_contact_or_fake('test test', '*****@*****.**') sub = is_subscribed(c) self.assertFalse(sub)
def testExplicitSubscribed(self): c = get_contact_or_fake("test test", "*****@*****.**") results = update_subscription(c, True) sub = is_subscribed(c) self.assertTrue(sub)
def testExplicitUnsubscribed(self): c = get_contact_or_fake("test test", "*****@*****.**") results = update_subscription(c, False) sub = is_subscribed(c) self.assertFalse(sub)
def testNewIsUnsubscribed(self): c = get_contact_or_fake("test test", "*****@*****.**") sub = is_subscribed(c) self.assertFalse(sub)