Ejemplo n.º 1
0
class SubscriptionDetailGet(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Rafael Henrique da Silva Correia',
            cpf='12345678901',
            email='*****@*****.**',
            phone='00-90000-9000',
        )
        self.obj.save()
        self.resp = self.client.get(r('subscriptions:detail', self.obj.pk))

    def test_get(self):
        self.assertEqual(200, self.resp.status_code)

    def test_template(self):
        self.assertTemplateUsed(self.resp,
                                'subscriptions/subscription_detail.html')

    def test_context(self):
        subscription = self.resp.context['subscription']
        self.assertIsInstance(subscription, Subscription)

    def test_html(self):
        contents = (
            self.obj.name, self.obj.cpf,
            self.obj.email, self.obj.phone)
        with self.subTest():
            for expected in contents:
                self.assertContains(self.resp, expected)
Ejemplo n.º 2
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Manaia Junior',
            cpf='1234567890',
            email='*****@*****.**',
            phone='84-988929399'
        )
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Manaia Junior', str(self.obj))

    def test_paid_default_to_False(self):
        """By default paid must be False."""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 3
0
class SubscriptionTest(TestCase):

    def setUp(self):
        self.obj = Subscription(
            name='Junior Vidotti',
            cpf='12345678901',
            email='*****@*****.**',
            phone='65-92054852',
            )

    def test_create(self):
        'Test if saves'
        self.obj.save()
        self.assertEqual(1, self.obj.pk)

    def test_has_created_at(self):
        'Test if has create_at'
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_unicode(self):
        self.assertEqual(u'Junior Vidotti', unicode(self.obj))

    def test_paid_default_value_false(self):
        'paid must be False by default'
        self.assertEqual(False, self.obj.paid)
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Vitor Hidalgo',
            cpf='12345678901',
            email='*****@*****.**',
            phone='11-971689949'
        )
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())


    def test_created_at(self):
        """Subscription must have an auto created_at attr"""
        self.assertIsInstance(self.obj.created_at, datetime)


    def test_str(self):
        self.assertEqual('Vitor Hidalgo', str(self.obj))


    def test_paid_default_to_false(self):
        """By default paid must be False"""
        self.assertEquals(False, self.obj.paid)
Ejemplo n.º 5
0
    def setUp(self):
        self.obj = Subscription(name='Eric Patrick',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='62-99685-1234')

        self.obj.save()
Ejemplo n.º 6
0
    def setUp(self):
        self.obj = Subscription(name='Vitor',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='21-981275014')

        self.obj.save()
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Carlos Eduardo Nogueira',
            cpf='12345678912',
            email='*****@*****.**',
            phone='11-912345678'
        )
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """ Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Carlos Eduardo Nogueira', str(self.obj))

    def test_paid_default_to_False(self):
        """By default, paid must be False."""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 8
0
class SubscriptionsTest(TestCase):
	def setUp(self):
		self.obj = Subscription(
			name='Fellipe Pinheiro',
			cpf='12345678901',
			email='*****@*****.**',
			phone='21-00000000'
		)

	def test_create(self):
		'Subscription must have name, cpf, email, phone'
		self.obj.save()
		self.assertEqual(1, self.obj.id)

	def test_has_created_at(self):
		'Subscription must have automatic created_at'
		self.obj.save()
		self.assertIsInstance(self.obj.created_at, datetime)

	def test_unicode(self):
		self.assertEqual(u'Fellipe Pinheiro', unicode(self.obj))

	def test_paid_default_value_is_False(self):
		'By default paid must be False'
		self.assertEqual(False, self.obj.paid)
Ejemplo n.º 9
0
class SubscriptionModelTest(TestCase):
    """docstring for model of subscribe."""
    def setUp(self):
        """Set variables."""
        self.obj = Subscription(name='Henrique Bastos',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='21-996186180')
        self.obj.save()

    def test_create(self):
        """Create model."""
        self.assertTrue(Subscription.objects.exists())

    def test_create_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        """Subscription must have name of the registered."""
        self.assertEqual('Henrique Bastos', str(self.obj))

    def test_paid_default_to_false(self):
        """By default paid must be False."""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        """Url must have a address."""
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
class subscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name = 'Cleber Fonseca',
            cpf = '12345678901',
            email = '*****@*****.**',
            phone = '53-99487480'
        )

        self.obj.save()


    def test_create(self):
        self.assertTrue(Subscription.objects.exists())


    def test_created_at(self):
        self.assertIsInstance(self.obj.created_at, datetime)


    def test_str(self):
        self.assertEqual('Cleber Fonseca', str(self.obj))


    def test_paid_default_to_false(self):
        """By default paid must False"""
        self.assertEqual(False, self.obj.paid)


    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj. pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 11
0
 def setUp(self):
     """Set variables."""
     self.obj = Subscription(name='Henrique Bastos',
                             cpf='12345678901',
                             email='*****@*****.**',
                             phone='21-996186180')
     self.obj.save()
Ejemplo n.º 12
0
class SubscriptionTestCase(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Wallace Coelho',
            cpf='123',
            email='*****@*****.**',
            phone='123'
        )
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr"""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual("Wallace Coelho", str(self.obj))

    def test_paid_default_to_False(self):
        """By default pait must be False."""
        self.assertEqual(False, self.obj.paid)

    def test_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 13
0
class SubscriptionTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Matheus Guilarducci',
            cpf='01234567890',
            email='*****@*****.**',
            phone='21-99999-8888'
        )

    def test_create(self):
        """
        Subscription must have name, cpf, email and phone
        """
        self.obj.save()
        self.assertEqual(1,self.obj.pk)

    def test_has_created_at(self):
        """
        Subscription must have automatic created_at
        """
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_unicode(self):
        self.assertEqual(u'Matheus Guilarducci', unicode(self.obj))
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(name='Hiarison Gigante',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='+55 21 9900 9900')
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Hiarison Gigante', str(self.obj))

    def test_paid_default_to_False(self):
        """By Default paid must be False"""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 15
0
    def setUp(self):
        self.obj = Subscription(name='Jasiel Serra',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='75-99157-8787')

        self.obj.save()
Ejemplo n.º 16
0
class SubcriptionModelTest(TestCase):

    def setUp(self):

        self.obj = Subscription(
            name='thiago oliveira',
            cpf=12345678901,
            email='*****@*****.**',
            phone='011-97051-3508'
        )
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """ Subscription Must have an auto created_at attrib """
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Thiago Oliveira', str(self.obj))

    def test_paid_default_false(self):
        """Must have default false"""
        self.assertEquals(self.obj.paid, False)
Ejemplo n.º 17
0
class SubscriptionModelTest(TestCase):
	def setUp(self):
		self.obj = Subscription(
				name='Izabela Guerreiro',
				cpf='12345678901',
				email='*****@*****.**',
				phone='12-99126-6633'
			)
		self.obj.save()
	
	def test_create(self):	
		self.assertTrue(Subscription.objects.exists())

	def test_created_at(self):
		""" Subscription must have an auto created_at attr """
		self.assertIsInstance(self.obj.created_at, datetime)

	def test_str(self):
		self.assertEqual('Izabela Guerreiro', str(self.obj))

	def test_paid_default_to_False(self):
		""" By default paid must be False """
		self.assertEqual(False, self.obj.paid)

	def test_get_absolute_url(self):
		url = r('subscriptions:detail', self.obj.pk)
		self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 18
0
 def setUp(self):
     self.obj = Subscription(
         name='Henrique Bastos',
         cpf='12345678901',
         email='*****@*****.**',
         phone='21-96186180'
     )
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name = 'Orlando Xavier',
            cpf = '12345678901',
            email = '*****@*****.**',
            phone = '83-99619-8699',
        )
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Orlando Xavier', str(self.obj))

    def test_paid_default_to_False(self):
        """By default, paid must be False."""
        return self.assertFalse(self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 20
0
class SubscriptionTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name = 'Victor Hugo Novais',
            cpf = '12345678910',
            email = '*****@*****.**',
            phone = '21-99999999',
        )

    def test_create(self):
        'Subscription must have name, cpf, email and phone'
        self.obj.save()
        self.assertEqual(1, self.obj.id)

    def test_created_at(self):
        'The field created_at must be the current datetime'
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_unicode(self):
        self.assertEqual(u'Victor Hugo Novais', unicode(self.obj))

    def test_paid_default_value_is_false(self):
        'By default, paid must be false'
        self.assertEqual(False,self.obj.paid)
Ejemplo n.º 21
0
class SubscriptionTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Ivan Rocha',
            cpf='012345678901',
            email='*****@*****.**',
            phone='84-87598888',
        )

    def test_create(self):
        'Subscription must have name, cpf, email, phone'
        self.obj.save()
        self.assertEqual(self.obj.id, 1)

    def test_has_created_at(self):
        'Subscription must have automatic created_at'
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_unicode(self):
        self.assertEqual(u'Ivan Rocha', unicode(self.obj))

    def test_paid_default_value_is_false(self):
        'By default paid must be False'
        self.assertEqual(False, self.obj.paid)
Ejemplo n.º 22
0
 def setUp(self):
     self.startTime = time()
     self.obj = Subscription(name='Ramiro Alvaro',
                             cpf='12345678901',
                             email='*****@*****.**',
                             phone='31-991387178')
     self.obj.save()
Ejemplo n.º 23
0
class SubscriptionModelTest(TestCase):

    def setUp(self):
        self.obj = Subscription(name='John Doe',
                                cpf='12345678900',
                                email='*****@*****.**',
                                phone='2345678')
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('John Doe', str(self.obj))

    def test_paid_default_to_false(self):
        """By default paid must be False"""
        self.assertFalse(self.obj.paid)

    def test_get_absolute_url(self):
        self.assertEqual(self.obj.get_absolute_url(),
                         resolve_url('subscriptions:detail', self.obj.pk))
Ejemplo n.º 24
0
class SubscriptionTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Thiago Dorneles',
            cpf='12345678901',
            email='*****@*****.**',
            phone='51 9246.5987'
        )

    def test_create(self):
        'Subscription must have name, cpf, email, phone'
        self.obj.save()
        self.assertEqual(1, self.obj.id)

    def test_has_created_at(self):
        'Subscription must have automatic created_at'
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_unicode(self):
        self.assertEqual(u'Thiago Dorneles', unicode(self.obj))

    def test_paid_default_value_is_False(self):
        'By default paid must be False'
        self.assertEqual(False, self.obj.paid)
Ejemplo n.º 25
0
class SubscriptionTest(TestCase):
	
	def setUp(self):
		self.obj = Subscription(
				name = 'Marcos Saito',
				cpf = '12345678901',
				email = '*****@*****.**',
				phone = '21-96186190',
				paid = False
			)
	
	def test_create(self):
		'Subscription must have name, cpf, email, phone'
		self.obj.save()
		self.assertEqual(1, self.obj.id)

	def test_has_created_at(self):
		'Subscription must have atomatic created_at.'
		self.obj.save()
		self.assertIsInstance(self.obj.created_at, datetime)

	def test_unicode(self):
		self.assertEqual(u'Marcos Saito', unicode(self.obj	))

	def test_paid_default_value_is_False(self):
		'By default piad must be False.'
		self.assertEqual(False, self.obj.paid)
Ejemplo n.º 26
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(name='Eliézer Bourchardt',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='49984020730')
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_create_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Eliézer Bourchardt', str(self.obj))

    def test_paid_default_to_False(self):
        """By default paid must be False."""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 27
0
class SubscrtionTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name = u'Élysson MR',
            cpf = '12345678901',
            email = '*****@*****.**',
            phone = '35-98765432'
        )        

    def test_create(self):
        'Subscription mus have name, cpf, email and phone'
        self.obj.save()
        self.assertEqual(1, self.obj.id)

    def test_has_created_at(self):
        'Subscription must have automatic created_at'
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_unicode(self):
        'Must be the name of subscriptor'
        self.assertEqual(u'Élysson MR', unicode(self.obj))

    def test_paid_default_value_is_false(self):
        'By default paid must be False.'
        self.assertEqual(False, self.obj.paid)
Ejemplo n.º 28
0
class SubscriptionTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
        name=u'Márcio Ramos Corrêa', #'u' do unicode!
        cpf='12345678901',
        email='*****@*****.**',
        phone='14-96274121'
        )

    def test_create(self):
        'Subscription must have name, cpf, email, phone'
        self.obj.save()
        self.assertEqual(1, self.obj.id)

    def test_has_created_at(self):
        'Subscription must have automatic created_at'
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_unicode(self):
        self.assertEqual(u'Márcio Ramos Corrêa', unicode(self.obj))

    def test_paid_default_value_is_False(self):
        'By default paid must be False.'
        self.assertEqual(False, self.obj.paid)
Ejemplo n.º 29
0
 def setUp(self):
     self.obj = Subscription(
         name = u'Élysson MR',
         cpf = '12345678901',
         email = '*****@*****.**',
         phone = '35-98765432'
     )        
Ejemplo n.º 30
0
class SubscriptionModelTests(TestCase):
    def setUp(self):
        self.obj = Subscription (
            name='Gabriel Pedroso',
            cpf='32445054818',
            email='*****@*****.**',
            phone='11-11111111'
        )
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """ Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Gabriel Pedroso', str(self.obj))

    def test_paid_default_False(self):
        """By default paid must be False."""
        self.assertEqual(False, self.obj.paid)

    def test_keyHash_not_blank(self):
        """keyHash can not be blank"""
        self.assertNotEqual('', self.obj.keyHash)
Ejemplo n.º 31
0
class SubscriptionTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Paulo Bender',
            cpf='12345678910',
            email='*****@*****.**',
            phone='51-84223608'
        )

    def test_create(self):
        'Subscription must have name, cpf, email, phone'
        self.obj.save()
        self.assertEqual(1, self.obj.id)

    def test_has_created_at(self):
        'Subscription must have automatic created_at'
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_unicode(self):
        self.assertEqual(u'Paulo Bender', unicode(self.obj))

    def test_paid_default_value_is_False(self):
        'By default paid must be False.'
        self.assertEqual(False, self.obj.paid)
Ejemplo n.º 32
0
class SubscriptionTest(TestCase):

    def setUp(self):
        self.obj = Subscription(
        name='Antonio Miquelini',
        cpf='12345678901',
        email='*****@*****.**',
        phone='11-988776620'
        ) 
        
    def test_create(self):
        'Subscription must have name, cpf, email, phone'
        self.obj.save()
        self.assertEqual(1, self.obj.id)
        print ' - Subscription must have name, cpf, email, phone'
        
    def test_has_created_at(self):
        'Subscription must have automatic created_at'
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)
        print ' - Subscription must have automatic created_at'
        
    def test_unicode(self):
        self.assertEqual(u'Antonio Miquelini', unicode(self.obj))
        print " - Testa a instancia com unicode u "
        
    def test_paid_defoault_value_is_False(self):
        'By default paid must be False.'
        self.assertEqual(False, self.obj.paid)
        print " - By default paid must be False."
Ejemplo n.º 33
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(name='Leonardo Gregorio de Almeida',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='48-99323622')
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Leonardo Gregorio de Almeida', str(self.obj))

    def test_paid_default_to_False(self):
        """By default paid must be False."""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_ulr(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 34
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Tiago Sá',
            cpf='12345678901',
            email='*****@*****.**',
            phone='91-98424-5276'
        )
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        self.assertIsInstance(self.obj.created_at, datetime)

    def teste_str(self):
        self.assertEqual('Tiago Sá', str(self.obj))

    def test_paid_default_to_false(self):
        """must default paid must be false"""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 35
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(name='Henrique Bastos',
                                email='*****@*****.**',
                                cpf='12345678901',
                                phone='21-12312342')
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Henrique Bastos', str(self.obj))

    def test_uuid(self):
        """Subscription must have an auto uuid attr."""
        self.assertIsInstance(self.obj.uuid, uuid.UUID)

    def test_paid_default_to_False(self):
        """By default paid must be False."""
        self.assertEqual(False, self.obj.paid)
Ejemplo n.º 36
0
class SubscriptionTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Henrique Bastos',
            cpf='12345678901',
            email='*****@*****.**',
            phone='21-96186180'
        )

    def test_create(self):
        """
        Subscription must have name, cpf, email, phone
        """
        self.obj.save()
        self.assertEqual(1, self.obj.id)

    def test_has_created_at(self):
        """
        Subscription must have automatic created_at
        """
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_unicode(self):
        self.assertEqual(u'Henrique Bastos', unicode(self.obj))

    def test_paid_default_value_is_False(self):
        'By default paid must be False.'
        self.assertEqual(False, self.obj.paid)
Ejemplo n.º 37
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(name='Leonardo Perrella',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='31-999469999')
        self.obj.save()

    def test_create(self):

        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr"""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Leonardo Perrella', str(self.obj))

    def test_paid_default_to_False(self):
        """by default paid must be false"""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 38
0
class SubscriptionTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Matheus Moreira',
            cpf='01234567890',
            email='*****@*****.**',
            phone='(21) 98888-7777'
        )

    def testCreate(self):
        'Subscription must have name, cpf, email, phone'
        self.obj.save()
        self.assertEqual(1, self.obj.pk)

    def testHasCreatedAt(self):
        'Subscription must have automatic created_at'
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)

    def testUnicode(self):
        self.assertEqual(u'Matheus Moreira', unicode(self.obj))

    def test_paid_default_value_is_False(self):
        'By default paid must be False.'
        self.assertEqual(False, self.obj.paid)
Ejemplo n.º 39
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(name='Rodrigo Queiroz',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='81 99999-9999')
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Rodrigo Queiroz', str(self.obj))

    def test_paid_default_to_False(self):
        """By default, paid must be false."""
        self.assertFalse(self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.hash_id)
        self.assertEqual(url, self.obj.get_absolute_url())
class SubscriptionTest(TestCase):
	def setUp(self):
		self.obj = Subscription(
			name='Alexsander Falcucci',
			cpf='12345678901',
			email='*****@*****.**',
			phone='35-99914903'
		)

	def test_create(self):
		# inscricao contem name, cpf, email e phone.
		self.obj.save()
		self.assertEqual(1, self.obj.pk)

	def test_has_created_at(self):
		# inscricao must have automatic created_at
		self.obj.save()
		self.assertIsInstance(self.obj.created_at, datetime)

	def test_unicode(self):
			self.assertEqual(u'Alexsander Falcucci', unicode(self.obj))

	def teste_paid_default_value_is_False(self):
		#By default paid must be False.
		self.assertEqual(False, self.obj.paid)
Ejemplo n.º 41
0
class SubscriptionTest(TestCase):
    def setUp(self):
        self.obj = Subscription(name='Ramiro Batista da Luz',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='41 9173-2231')
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscritpion must have a created_at attribute."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Ramiro Batista da Luz', str(self.obj))

    def test_paid_defautl_to_False(self):
        """By default paid must be False."""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 42
0
class SubscriptionTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Henrique Bastos',
            cpf='12345678901',
            email='*****@*****.**',
            phone='21-96186180'
        )
        
    def test_create(self):
        'Subscription must have name, cpf, email, phone'
        self.obj.save()
        self.assertEqual(1, self.obj.pk)
    
    def test_has_created_at(self):
        'Subscription must have automatic created_at'
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)
        
    def test_unicode(self):
        self.assertEqual(u'Henrique Bastos', unicode(self.obj))
        
    def test_paid_default_value_is_False(self):
        'By default paid must be False'
        self.assertEqual(False, self.obj.paid)
Ejemplo n.º 43
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name = 'Alisson Bittencourt',
            cpf = '12345678901',
            email = '*****@*****.**',
            phone = '21-1234-1258'
        )
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        self.assertIsInstance(self.obj.created_at,datetime)

    def test_str(self):
        self.assertEqual('Alisson Bittencourt', str(self.obj))

    def test_paid_default_to_false(self):
        self.assertEqual(False, self.obj.paid)

    def test_get_absolut_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 44
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.startTime = time()
        self.obj = Subscription(name='Ramiro Alvaro',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='31-991387178')
        self.obj.save()

    def tearDown(self):
        delta = time() - self.startTime
        print("{:.3f}".format(delta))

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Ramiro Alvaro', str(self.obj))

    def test_paid_default_to_False(self):
        """By default paid must be False."""
        self.assertEqual(False, self.obj.paid)
Ejemplo n.º 45
0
class SubscriptionTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Hugo Leonardo Costa e Silva',
            cpf='01624428665',
            email='*****@*****.**',
            phone='3288258109'
        )

    def test_create(self):
        'Subscription must have name, cpf, email, phone'
        self.obj.save()
        self.assertEquals(1, self.obj.id)

    def test_has_created_at(self):
        'Subscription must have automatic created_at'
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_unicode(self):
        'Subscription must have name field as unicode'
        self.assertEquals(u'Hugo Leonardo Costa e Silva', unicode(self.obj))
        
    def test_paid_default_value_is_False(self):
        'By default paid must be false'
        self.assertEqual(False, self.obj.paid)
Ejemplo n.º 46
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Rogerio Oliveira',
            cpf='31095929836',
            email='*****@*****.**',
            phone='11-980887373'
        )
        self.obj.save()

    def teste_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Rogerio Oliveira', str(self.obj))

    def test_paid_default_to_False(self):
        """By default paid must be False"""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 47
0
class SubscriptionsModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(name='Ramiro Alvaro',
                                cpf='2345678901',
                                email='*****@*****.**',
                                phone='31-99138-7178')
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto create at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Ramiro Alvaro', str(self.obj))

    def test_paid_default_to_False(self):
        """By default paid must be False"""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 48
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Joao Moacir Barth Junior',
            cpf='12345678901',
            email='*****@*****.**',
            phone='41-99999999'
        )
        self.obj.save()
    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Joao Moacir Barth Junior', str(self.obj))

    def test_paid_default_to_False(self):
        """By default paid must be False."""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 49
0
 def setUp(self):
     self.obj = Subscription(
         name='Luiz Felipe',
         cpf='37710722806',
         email='*****@*****.**',
         phone='12-982415558', )
     self.obj.save()
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(name='Alessandro de Lima Folk',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='43-99851513')
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Alessandro de Lima Folk', str(self.obj))

    def test_paid_default_to_false(self):
        """By default paid must be False"""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 51
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(name='Henrique Bastos',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='21-996186180')
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Henrique Bastos', str(self.obj))

    def test_paid_default_to_False(self):
        """By default paid must be False"""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.hashid)
        self.assertEqual(url, self.obj.get_absolute_url())
    def setUp(self):
        self.obj = Subscription(name='Vinicius Santos',
                                cpf='12345678901',
                                email='*****@*****.**',
                                phone='79-99999-9999')

        self.obj.save()
Ejemplo n.º 53
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Henrique Bastos',
            cpf='12345678901',
            email='*****@*****.**',
            phone='21-996186180'
        )
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr"""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Henrique Bastos', str(self.obj))

    def test_paid_default_to_false(self):
        """By default paid must be false"""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 54
0
class SubscriptionTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Marcos Ribeiro',
            cpf='12345678901',
            email='*****@*****.**',
            phone='2345678'
        )

    def test_create(self):
        'Subscription deve ter name, cpf, email, phone'
        self.obj.save()
        self.assertEqual(1, self.obj.id)

    def test_has_created_at(self):
        'Subscription deve criar automaticamente o created_at'
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_unicode(self):
        self.assertEqual(u'Marcos Ribeiro', unicode(self.obj))

    def test_paid_default_value_is_False(self):
        'Por default o paid deve ser False'
        self.assertEqual(False, self.obj.paid)
Ejemplo n.º 55
0
class Subscriptiontest(TestCase):
    def setUp(self):
        self.obj = Subscription(
                name='Fulano de Tal',
                cpf='12345678901',
                email='*****@*****.**',
                phone='112233445566'
        )

    def test_create(self):
        """Subscriptions must havename, cpf, email, phone."""
        self.obj.save()
        self.assertEqual(1, self.obj.pk)

    def test_has_created_at(self):
        """Subscription must have automatic created at."""
        self.obj.save()
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_unicode(self):
        """Must handle unicode."""
        self.assertEqual(u'Fulano de Tal', unicode(self.obj))

    def test_paid_default_value_is_false(self):
        """Default must be false."""
        self.assertEqual(False, self.obj.paid)
Ejemplo n.º 56
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Paulo Roberto',
            cpf='12345678901',
            email='*****@*****.**',
            phone='12-99221-8616',
        )
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Paulo Roberto', str(self.obj))

    def test_paid_default_to_False(self):
        """By default, paid must be False."""
        return self.assertFalse(self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 57
0
class SubscriptionTest(TestCase):
    def setUp(self):
        self.object = Subscription(name='Filipe Manuel',
                                   cpf='06616141403',
                                   email='*****@*****.**',
                                   phone='82-96427829')

    def test_create(self):
        """
        Subscription must have name, cpf, email and phone
        """
        self.object.save()
        self.assertEqual(1, self.object.id)

    def test_has_created_at(self):
        """
        Subscription must have automatic created_at
        """
        self.object.save()
        self.assertIsInstance(self.object.created_at, datetime)

    def test_unicode(self):
        self.assertEqual(u'Filipe Manuel', unicode(self.object))

    def test_paid_default_value_is_False(self):
        """
        By default paid must be a false
        """
        self.assertEqual(False, self.object.paid)
Ejemplo n.º 58
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
            name='Guilherme Bagnato',
            cpf='12345678901',
            email='*****@*****.**',
            phone='16-997794468',
        )
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription must have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Guilherme Bagnato', str(self.obj))

    def test_paid_default_to_False(self):
        """By default paid must be False."""
        self.assertEqual(False, self.obj.paid)

    def test_get_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())
Ejemplo n.º 59
0
class SubscriptionModelTest(TestCase):
    def setUp(self):
        self.obj = Subscription(
                name='Fabrício Severo',
                cpf='12345678901',
                email='*****@*****.**',
                phone='00-1111-2222'
        )
        self.obj.save()

    def test_create(self):
        self.assertTrue(Subscription.objects.exists())

    def test_created_at(self):
        """Subscription mus have an auto created_at attr."""
        self.assertIsInstance(self.obj.created_at, datetime)

    def test_str(self):
        self.assertEqual('Fabrício Severo', str(self.obj))

    def test_paid_default_to_false(self):
        """By default, paid must be false"""
        self.assertEqual(False, self.obj.paid)

    def test_absolute_url(self):
        url = r('subscriptions:detail', self.obj.pk)
        self.assertEqual(url, self.obj.get_absolute_url())