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


Python Speaker.save方法代码示例

本文整理汇总了Python中eventex.core.models.Speaker.save方法的典型用法代码示例。如果您正苦于以下问题:Python Speaker.save方法的具体用法?Python Speaker.save怎么用?Python Speaker.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eventex.core.models.Speaker的用法示例。


在下文中一共展示了Speaker.save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: SpeakerDetailTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
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,代码行数:29,代码来源:test_views_speaker_detail.py

示例2: SpeakerModelTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
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,代码行数:29,代码来源:test_models_speaker_contact.py

示例3: ContactModelTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
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,代码行数:35,代码来源:test_models.py

示例4: SpeakerModelTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
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,代码行数:13,代码来源:test_models.py

示例5: SpeakerModelTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
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,代码行数:15,代码来源:test_models.py

示例6: SpeakerModelTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
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,代码行数:16,代码来源:test_models.py

示例7: SpeakerModelTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
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,代码行数:16,代码来源:test_models.py

示例8: SpeakerModelTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
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,代码行数:17,代码来源:test_models.py

示例9: SpeakerModelTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
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,代码行数:17,代码来源:test_models.py

示例10: SpeakerModel

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
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,代码行数:17,代码来源:test_models.py

示例11: SpeakerModelTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
class SpeakerModelTest(TestCase):
    def setUp(self):
        self.speaker = Speaker(name='Marcos Ribeiro',
                               slug='marcos-ribeiro',
                               url='http://marcosribeiro.com',
                               description='Developer')
        self.speaker.save()

    def test_create(self):
        'Instancia de Speaker deve ser salva'
        self.assertEqual(1, self.speaker.pk)

    def test_unicode(self):
        'unicode de Speaker deve ser o nome'
        self.assertEqual(u'Marcos Ribeiro', unicode(self.speaker))
开发者ID:marcosmribeiro,项目名称:wttd,代码行数:17,代码来源:test_models.py

示例12: SpeakerModelTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
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,代码行数:17,代码来源:test_models.py

示例13: SpeakerModelTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
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,代码行数:17,代码来源:test_models.py

示例14: SpeakerModelTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
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,代码行数:17,代码来源:test_models.py

示例15: SpeakerModelTest

# 需要导入模块: from eventex.core.models import Speaker [as 别名]
# 或者: from eventex.core.models.Speaker import save [as 别名]
class SpeakerModelTest(TestCase):
	def setUp(self):
		self.speaker = Speaker(name='Anderson Dadario',
			slug='anderson-dadario',
			url='https://dadario.com.br',
			description='Software Security Consultant'
		)
		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'Anderson Dadario', unicode(self.speaker))
开发者ID:andersonDadario,项目名称:WTTD,代码行数:18,代码来源:test_models.py


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