示例#1
0
文件: tests.py 项目: jimmcgaw/levicci
 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)
示例#2
0
文件: tests.py 项目: yusufbs/satchmo
    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))
示例#3
0
文件: tests.py 项目: abrar78/satchmo
 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)
示例#4
0
文件: tests.py 项目: yusufbs/satchmo
    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)
示例#5
0
文件: tests.py 项目: abrar78/satchmo
 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))
示例#6
0
文件: tests.py 项目: jimmcgaw/levicci
 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))
示例#7
0
    def get_contact(self):
        data = self.cleaned_data
        email = data['email']
        full_name = data['full_name']

        return get_contact_or_fake(full_name, email)
示例#8
0
文件: tests.py 项目: abrar78/satchmo
 def  testExplicitSubscribed(self):
     c = get_contact_or_fake('test test', '*****@*****.**')
     results = update_subscription(c, True)
     sub = is_subscribed(c)
     self.assertTrue(sub)
示例#9
0
文件: tests.py 项目: abrar78/satchmo
 def  testExplicitUnsubscribed(self):
     c = get_contact_or_fake('test test', '*****@*****.**')
     results = update_subscription(c, False)
     sub = is_subscribed(c)
     self.assertFalse(sub)
示例#10
0
文件: tests.py 项目: abrar78/satchmo
 def  testNewIsUnsubscribed(self):
     c = get_contact_or_fake('test test', '*****@*****.**')
     sub = is_subscribed(c)
     self.assertFalse(sub)
示例#11
0
文件: tests.py 项目: yusufbs/satchmo
 def testExplicitSubscribed(self):
     c = get_contact_or_fake("test test", "*****@*****.**")
     results = update_subscription(c, True)
     sub = is_subscribed(c)
     self.assertTrue(sub)
示例#12
0
文件: tests.py 项目: yusufbs/satchmo
 def testExplicitUnsubscribed(self):
     c = get_contact_or_fake("test test", "*****@*****.**")
     results = update_subscription(c, False)
     sub = is_subscribed(c)
     self.assertFalse(sub)
示例#13
0
文件: tests.py 项目: yusufbs/satchmo
 def testNewIsUnsubscribed(self):
     c = get_contact_or_fake("test test", "*****@*****.**")
     sub = is_subscribed(c)
     self.assertFalse(sub)
示例#14
0
 def get_contact(self):
     data = self.cleaned_data
     email = data['email']
     full_name = data['full_name']
     
     return get_contact_or_fake(full_name, email)