本文整理汇总了Python中eventex.core.models.Speaker类的典型用法代码示例。如果您正苦于以下问题:Python Speaker类的具体用法?Python Speaker怎么用?Python Speaker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Speaker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ContactModelTest
class ContactModelTest(TestCase):
def setUp(self):
self.speaker = Speaker(name='Ivan Rocha',
slug='ivan-rocha',
url='http://ivanneto.com.br',
description='Passionate software developer!')
self.speaker.save()
def test_email(self):
contact = Contact.objects.create(speaker=self.speaker, kind='E',
value='[email protected]')
self.assertEqual(1, contact.pk)
def test_phone(self):
contact = Contact.objects.create(speaker=self.speaker, kind='P',
value='84-87592558')
self.assertEqual(1, contact.pk)
def test_fax(self):
contact = Contact.objects.create(speaker=self.speaker, kind='F',
value='84-32138475')
self.assertEqual(1, contact.pk)
def test_kind(self):
'Contact kind should be limited to E, P or F.'
contact = Contact(speaker=self.speaker, kind='A', value='B')
self.assertRaises(ValidationError, contact.full_clean)
def test_unicode(self):
'Contact string representation sould be value.'
contact = Contact(speaker=self.speaker, kind='E',
value='[email protected]')
self.assertEqual(u'[email protected]', unicode(contact))
示例2: SpeakerModelTest
class SpeakerModelTest(TestCase):
"""
Test class.
"""
def setUp(self):
"""
Test initialization.
"""
self.speaker = Speaker(
name='Davi Garcia',
slug='davi-garcia',
url='http://www.davigarcia.com.br',
description='Passionate software developer!'
)
self.speaker.save()
def test_create(self):
"""
Speaker instance must be saved.
"""
self.assertEqual(1, self.speaker.pk)
def test_unicode(self):
"""
Speaker string representation should be the name.
"""
self.assertEqual(u'Davi Garcia', unicode(self.speaker))
示例3: SpeakerDetailTest
class SpeakerDetailTest(TestCase):
def setUp(self):
self.speaker = Speaker(name='Ivan Rocha',
slug='ivan-rocha',
url='http://ivanneto.com.br',
description='Passionate software developer!')
self.speaker.save()
url = r('core:speaker_detail', kwargs={'slug': 'ivan-rocha'})
self.resp = self.client.get(url)
def test_get(self):
'Get should result in 200.'
self.assertEqual(200, self.resp.status_code)
def test_template(self):
'Homepage must use template speaker_detail.html.'
self.assertTemplateUsed(self.resp, 'core/speaker_detail.html')
def test_html(self):
self.assertContains(self.resp, 'Ivan Rocha')
self.assertContains(self.resp, 'Passionate software developer')
self.assertContains(self.resp, 'http://ivanneto.com.br')
def test_context(self):
'Speaker must be in context.'
speaker = self.resp.context['speaker']
self.assertIsInstance(speaker, Speaker)
示例4: SpeakerModelTest
class SpeakerModelTest(TestCase):
def setUp(self):
self.speaker = Speaker(name='Henrique Bastos',
slug='henrique-bastos',
url='http://henriquebastos.net',
description='Passionate software developer!')
self.speaker.save()
def test_create(self):
'Speaker instance should be saved.'
self.assertEqual(1, self.speaker.pk)
示例5: SpeakerModelTest
class SpeakerModelTest(TestCase):
def setUp(self):
self.speaker = Speaker(name='Gilmar Soares',
slug='gilmar-soares',
url='http://about.me/gilmar.soares',
description ='Passionate software developer!')
self.speaker.save()
def test_create(self):
self.assertEqual(1, self.speaker.pk)
def test_unicode(self):
self.assertEqual(u'Gilmar Soares', unicode(self.speaker))
示例6: SpeakerModelTest
class SpeakerModelTest(TestCase):
def setUp(self):
self.speaker = Speaker(name = u'Élysson MR',
slug = 'elysson-mr', url = 'http://google.com',
description = "Assassins Creed Player")
self.speaker.save()
def test_create(self):
'Speaker instance should be saved.'
self.assertEqual(1, self.speaker.pk)
def test_unicode(self):
'Speaker representing string shuld be the name'
self.assertEqual(u'Élysson MR', unicode(self.speaker))
示例7: SpeakerModelTest
class SpeakerModelTest(TestCase):
def setUp(self):
self.speaker = Speaker(name='Joao Guedes',
slug='Joao-Guedes', url='http://joaoguedes.eu',
description='Passionate software developer!')
self.speaker.save()
def test_create(self):
'Speaker instance should be saved.'
self.assertEqual(1, self.speaker.pk)
def test_unicode(self):
'Speaker string representation should be the name.'
self.assertEqual(u'Joao Guedes', unicode(self.speaker))
示例8: SpeakerModelTest
class SpeakerModelTest(TestCase):
def setUp(self):
self.speaker = Speaker(name='Alexsander Falcucci',
slug='alexsander-falcucci',
url='http://alexsanderfalcucci.com',
description='Passionate Software Developer!!!')
self.speaker.save()
def test_create(self):
#Speaker instance should be saved.
self.assertEqual(1, self.speaker.pk)
def test_unicode(self):
#Speaker string representation should be the name.
self.assertEqual(u'Alexsander Falcucci', unicode(self.speaker))
示例9: SpeakerModelTest
class SpeakerModelTest(TestCase):
def setUp(self):
self.speaker = Speaker(name='Fernando Chimi',
slug='fernando-chimi',
url='http://chimiapp.heroku.com',
description='Blablabla')
self.speaker.save()
def test_create(self):
'Speaker instance should be saved'
self.assertEqual(1, self.speaker.pk)
def test_unicode(self):
'Speaker string representation should be the name.'
self.assertEqual(u'Fernando Chimi', unicode(self.speaker))
示例10: SpeakerModel
class SpeakerModel(TestCase):
def setUp(self):
self.speaker = Speaker(name='Mauricio Sipmann',
slug='mauricio-sipmann',
url='http://sipmann.com',
description='Vai saber')
self.speaker.save()
def test_create(self):
'Speaker deve impactar no banco'
self.assertEqual(1, self.speaker.pk)
def test_unicode(self):
'Speaker deve ter uma funcao unicode'
self.assertEqual(u'Mauricio Sipmann', unicode(self.speaker))
示例11: SpeakerModelTest
class SpeakerModelTest(TestCase):
def setUp(self):
self.speaker = Speaker(name='Darlene Medeiros',
slug='darlene-medeiros',
url='http://darlenemedeiros.com.br',
description='Passionate software developer!')
self.speaker.save()
def test_create(self):
'Speaker instance should be saved.'
self.assertEqual(1, self.speaker.pk)
def test_unicode(self):
'Speaker string representation should be the name.'
self.assertEqual(u'Darlene Medeiros', unicode(self.speaker))
示例12: SpeakerModelTest
class SpeakerModelTest(TestCase):
def setUp(self):
self.speaker = Speaker(name='Ivan Rocha',
slug='ivan-rocha',
url='http://ivanneto.com.br',
description='Passionate software developer!')
self.speaker.save()
def test_create(self):
'Speaker instance should be saved'
self.assertEqual(1, self.speaker.pk)
def test_unicode(self):
'Speaker string representation should be the name'
self.assertEqual(u'Ivan Rocha', unicode(self.speaker))
示例13: SpeakerModelTest
class SpeakerModelTest(TestCase):
def setUp(self):
self.speaker = Speaker(name='Guilherme Marostica',
slug='guilherme-marostica',
url='softsoftwares.com',
description='Iniciante no mundo dos Softwares!')
self.speaker.save()
def test_created(self):
'Speaker instance should be saved.'
self.assertEqual(1, self.speaker.pk)
def test_unicode(self):
'Speaker string representation should be the name.'
self.assertEqual(u'Guilherme Marostica', unicode(self.speaker))
示例14: SpeakerModelTest
class SpeakerModelTest(TestCase):
def setUp(self):
self.speaker = Speaker(name='Felipe Scampini',
slug='felipe-scampini',
url='http://fscampini.net',
description='Passionate software developer!')
self.speaker.save()
def test_create(self):
'Speaker instance should be saved'
self.assertEqual(1, self.speaker.pk)
def test_unicode(self):
'Self string representation should be the name.'
self.assertEqual(u'Felipe Scampini', unicode(self.speaker))
示例15: setUp
def setUp(self):
self.speaker = Speaker(name='Giovani J. Fontana',
slug='giovani-j-fontana',
url='http://eventex-fontanagiovani.herokuapp.com',
description='De volta ao desenvolvimento de software!')
self.speaker.save()