当前位置: 首页>>代码示例>>Python>>正文


Python models.Speaker类代码示例

本文整理汇总了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))
开发者ID:ivancrneto,项目名称:wttd,代码行数:33,代码来源:test_models.py

示例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))
开发者ID:davivcgarcia,项目名称:wttd-15,代码行数:27,代码来源:test_models_speaker_contact.py

示例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)
开发者ID:ivancrneto,项目名称:wttd,代码行数:27,代码来源:test_views_speaker_detail.py

示例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)
开发者ID:alcivancosta,项目名称:eventex-alcivan,代码行数:11,代码来源:test_models.py

示例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))
开发者ID:linuxsoares,项目名称:eventex-gilmar,代码行数:13,代码来源:test_models.py

示例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))
开发者ID:elyssonmr,项目名称:wttd,代码行数:14,代码来源:test_models.py

示例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))
开发者ID:joplen,项目名称:Eventex,代码行数:14,代码来源:test_models.py

示例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))
开发者ID:alexfalcucc,项目名称:eventex-wttd-alexfalcucci,代码行数:15,代码来源:test_models.py

示例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))
开发者ID:fernandochimi,项目名称:wttd,代码行数:15,代码来源:test_models.py

示例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))
开发者ID:sipmann,项目名称:wttd,代码行数:15,代码来源:test_models.py

示例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))
开发者ID:darlenedms,项目名称:EventeX,代码行数:15,代码来源:test_models.py

示例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))
开发者ID:ivancrneto,项目名称:wttd,代码行数:15,代码来源:test_models.py

示例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))
开发者ID:GuilhermeMarostica,项目名称:wttd,代码行数:15,代码来源:test_models.py

示例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))
开发者ID:fscampini,项目名称:scampiniwttd,代码行数:15,代码来源:test_models.py

示例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()
开发者ID:fontanagiovani,项目名称:eventex,代码行数:7,代码来源:test_models.py


注:本文中的eventex.core.models.Speaker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。