本文整理汇总了Python中subscriber.Subscriber.company方法的典型用法代码示例。如果您正苦于以下问题:Python Subscriber.company方法的具体用法?Python Subscriber.company怎么用?Python Subscriber.company使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类subscriber.Subscriber
的用法示例。
在下文中一共展示了Subscriber.company方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_field_length
# 需要导入模块: from subscriber import Subscriber [as 别名]
# 或者: from subscriber.Subscriber import company [as 别名]
def test_field_length(self):
"""test if the fields in the output file does not exceed character limits"""
big_string = ''.join(['b' for i in xrange(1, 40)])
subscriber = Subscriber()
subscriber.lastname = big_string
subscriber.firstname = big_string
subscriber.company = big_string
a = Address()
a.address1 = big_string
a.address2 = big_string
a.post_code = 123456
a.city = big_string
subscriber.address = a
subscriber.issues_to_receive = 10
subscriber.save()
line = self.export_and_get_first_line()
splitted_line = line.split('\t')
self.assertTrue(len(splitted_line[0]) <= 20)
self.assertTrue(len(splitted_line[1]) <= 12)
self.assertTrue(len(splitted_line[2]) <= 32)
self.assertTrue(len(splitted_line[3]) <= 20)
self.assertTrue(len(splitted_line[4]) <= 32)
self.assertTrue(len(splitted_line[5]) <= 32)
self.assertTrue(len(splitted_line[6]) <= 32)
self.assertTrue(len(splitted_line[7]) <= 32)
self.assertTrue(len(splitted_line[8]) <= 5)
self.assertTrue(len(splitted_line[9]) <= 26)
self.assertTrue(len(splitted_line[10]) <= 8)
self.assertTrue(len(splitted_line[11]) <= 3)
self.assertTrue(len(splitted_line[12]) <= 32)
self.assertTrue(len(splitted_line[13]) <= 32)
self.assertTrue(len(splitted_line[14]) <= 32)
self.assertTrue(len(splitted_line[15]) <= 32)
示例2: init_company_subscriber_without_name
# 需要导入模块: from subscriber import Subscriber [as 别名]
# 或者: from subscriber.Subscriber import company [as 别名]
def init_company_subscriber_without_name(self):
"""Initialize a subscriber without name info but with company info."""
sub = Subscriber()
sub.company = 'Google'
a = Address()
a.address1 = 'Address'
a.city = 'USA'
sub.address = a
sub.issues_to_receive = 0
sub.save()
示例3: save_basic_subscriber
# 需要导入模块: from subscriber import Subscriber [as 别名]
# 或者: from subscriber.Subscriber import company [as 别名]
def save_basic_subscriber(self):
sub = Subscriber()
sub.lastname = 'Doe'
sub.firstname = 'John'
sub.company = 'Apave'
a = Address()
a.city = 'Rouen'
sub.address = a
sub.issues_to_receive = 5
sub.hors_serie1 = 6
sub.subscription_price = 20
sub.membership_price = 30
sub.subscription_date = datetime.date(2011, 07, 12)
sub.save()
示例4: test_get_subs_by_email
# 需要导入模块: from subscriber import Subscriber [as 别名]
# 或者: from subscriber.Subscriber import company [as 别名]
def test_get_subs_by_email(self):
"""Test subscriber by email retrieval using the adapter"""
sub = Subscriber()
sub.lastname = 'toto'
sub.firstname = 'tata'
sub.company = 'Machin.corp'
sub.email_address = '[email protected]'
sub.name_addition = 'foobar'
sub.save()
dict_list = SubscriberAdapter.get_subscribers_from_email('[email protected]')
new_sub = dict_list[0]
self.assertEquals('toto', new_sub['lastname'])
self.assertEquals('tata', new_sub['firstname'])
self.assertEquals('[email protected]', new_sub['email_address'])
self.assertEquals('foobar', new_sub['name_addition'])
self.assertEquals('Machin.corp', new_sub['company'])
self.assertEquals(sub.identifier, new_sub['subscriber_id'])