Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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='*****@*****.**')
        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='*****@*****.**')
        self.assertEqual(u'*****@*****.**', unicode(contact))
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))
Exemplo n.º 4
0
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)
Exemplo n.º 5
0
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)
Exemplo n.º 6
0
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))
Exemplo n.º 7
0
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))
Exemplo n.º 8
0
class SpeakerModelTest(TestCase):
    def setUp(self):
        self.speaker = Speaker(name='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)

    def test_unicode(self):
        'Speaker string representation should be name.'
        self.assertEqual(u'Henrique Bastos', unicode(self.speaker))
Exemplo n.º 9
0
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))
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))
Exemplo n.º 11
0
class SpeakerModelTest(TestCase):
    def setUp(self):
        self.speaker = Speaker(name='Matheus Oliveira',
                               slug='matheus-oliveira',
                               url='http://coder42.com/',
                               description='Passionate software developer!')
        self.speaker.save()

    def test_create(self):
        """ Speaker instance should be saved. """
        self.assertEquals(1, self.speaker.pk)

    def test_unicode(self):
        """ Speaker string representation should be the name. """
        self.assertEquals(u'Matheus Oliveira', unicode(self.speaker))
Exemplo n.º 12
0
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))
Exemplo n.º 13
0
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))
Exemplo n.º 14
0
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))
Exemplo n.º 15
0
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))
Exemplo n.º 16
0
class SpeakerModelTest(TestCase):
    def setUp(self):
        self.speaker = Speaker(name='Fellipe Castro',
                               slug='fellipe-castro',
                               url='http://fellipecastro.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'Fellipe Castro', unicode(self.speaker))
Exemplo n.º 17
0
class SpeakerModelTest(TestCase):
    def setUp(self):
        self.speaker = Speaker(name='Regis da Silva',
                               slug='regis-da-silva',
                               url='http://regis-wttd.herokuapp.com/',
                               description='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'Regis da Silva', unicode(self.speaker))
Exemplo n.º 18
0
class SpeakerModelTest(TestCase):
    def setUp(self):
        self.speaker = Speaker(name='Artur Sousa',
                               slug='artur-sousa',
                               url='http://artursousa.com.br',
                               description='Passionate software developer!')
        self.speaker.save()

    def test_create(self):
        'Speaker must have name, slug, url and description.'
        self.assertEqual(1, self.speaker.pk)

    def test_unicode(self):
        'Speaker string repr should be its name.'
        self.assertEquals(u'Artur Sousa', unicode(self.speaker))
Exemplo n.º 19
0
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))
Exemplo n.º 20
0
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))
Exemplo n.º 21
0
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))
Exemplo n.º 22
0
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))
Exemplo n.º 23
0
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))
Exemplo n.º 24
0
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))
Exemplo n.º 25
0
class SpeakerModelTest(TestCase):

    def setUp(self):
        self.speaker = Speaker(name='Matheus Oliveira',
                               slug='matheus-oliveira',
                               url='http://coder42.com/',
                               description='Passionate software developer!')
        self.speaker.save()

    def test_create(self):
        """ Speaker instance should be saved. """
        self.assertEquals(1, self.speaker.pk)

    def test_unicode(self):
        """ Speaker string representation should be the name. """
        self.assertEquals(u'Matheus Oliveira', unicode(self.speaker))
Exemplo n.º 26
0
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))
Exemplo n.º 27
0
class SpeakerModelTest(TestCase):
    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()

    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'Giovani J. Fontana', unicode(self.speaker))
Exemplo n.º 28
0
class SpeakerModelTest(TestCase):
    def setUp(self):
        self.speaker = Speaker(name='Márcio Ramos Corrêa',
            slug='marcio-ramos-correa', url='http://github.com/marciorc',
            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.'
        contact = Contact(speaker=self.speaker, kind='E',
            value='*****@*****.**')
        self.assertEqual(u'*****@*****.**', unicode (contact))
Exemplo n.º 29
0
class SpeakerModelTest(TestCase):
    def setUp(self):
        self.speaker = Speaker(
            name='Artur Sousa',
            slug='artur-sousa',
            url='http://artursousa.com.br',
            description='Passionate software developer!'
        )
        self.speaker.save()

    def test_create(self):
        'Speaker must have name, slug, url and description.'
        self.assertEqual(1, self.speaker.pk)

    def test_unicode(self):
        'Speaker string repr should be its name.'
        self.assertEquals(u'Artur Sousa', unicode(self.speaker))
Exemplo n.º 30
0
class SpeakerModelTest(TestCase):
    def setUp(self):
        self.speaker = Speaker(
            name='Felipe Ramos',
            slug='felipe-ramos',
            url='http://feliperamos.com',
            description='Web developer!'
        )
        self.speaker.save()

    def teste_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'Felipe Ramos', unicode(self.speaker))
Exemplo n.º 31
0
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, len( Speaker.objects.all() ) )

	def test_unicode(self):
		'Speaker string representation	 should be the name'
		
		self.assertEqual(u'Henrique Bastos', unicode(self.speaker))
Exemplo n.º 32
0
class SpeakerModelTest(TestCase):
	def setUp(self):
		self.speaker = Speaker(
			name='Regis da Silva',
			slug='regis-da-silva',
			url='http://regis-wttd.herokuapp.com/',
			description='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'Regis da Silva', unicode(self.speaker))
Exemplo n.º 33
0
class SpeakerModelTest(TestCase):
    def setUp(self):
        self.speaker = Speaker(name='Dyego Cantu', slug='dyego-cantu',
                url='http://dyegocantu.wordpress.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'Dyego Cantu', unicode(self.speaker))
Exemplo n.º 34
0
class SpeakerModelTest(TestCase):
    def setUp(self):
        self.speaker = Speaker(name='Filipe Manuel',
                               slug='filipe-manuel',
                               url='http://github.com/filipemanuelofs',
                               description='Lorem Ipsum')
        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'Filipe Manuel', unicode(self.speaker))
Exemplo n.º 35
0
class SpeakerModelTest(TestCase):
    def setUp(self):
        self.speaker = Speaker(name='Filipe Manuel',
                               slug='filipe-manuel',
                               url='http://github.com/filipemanuelofs',
                               description='Lorem Ipsum')
        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'Filipe Manuel', unicode(self.speaker))
Exemplo n.º 36
0
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='*****@*****.**')
        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='*****@*****.**')
        self.assertEqual(u'*****@*****.**', unicode(contact))