Ejemplo n.º 1
0
    def setUp(self):
        'Instancia o Model Admin'
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        Subscription.objects.create(name='Mauricio Sipmann',
                                    cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 2
0
    def setUp(self):
        # Instancia o Model admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        Subscription.objects.create(name='Ivan Rocha',
                                    cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 3
0
class MarkAsPaidTest(TestCase):
    """
    Test Class.
    """
    def setUp(self):
        """
        Creates an instance of Model Admin.
        """
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)
        Subscription.objects.create(
            name='Davi Garcia',
            cpf='12345678901',
            email='*****@*****.**',
            phone='(21) 1234-5678'
        )

    def test_has_action(self):
        """
        Action is installed.
        """
        self.assertIn('mark_as_paid', self.model_admin.actions)

    def test_mark_all(self):
        """
        Action to mark all selected as paid.
        """
        fake_request = Mock()
        queryset =  Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)
        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 4
0
class SubscriptionAdminTest(TestCase):
    def setUp(self):
        Subscription.objects.create(
            name='Nome Fictício',
            cpf='12345678901',
            email='*****@*****.**',
            phone='21-987654321'
        )

        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

    def test_has_action(self):
        """Action mark_as_paid should be installed"""
        self.assertIn('mark_has_paid', self.model_admin.actions)

    def test_mark_all(self):
        """It should mark all selected subscription has paid"""
        self.call_action()
        self.assertEqual(1, Subscription.objects.filter(paid=True).count())

    def test_message(self):
        """It should send a message to the user"""
        mock = self.call_action()
        mock.assert_called_once_with(None, '1 inscrição foi marcada como paga.')

    def call_action(self):
        queryset = Subscription.objects.all()

        mock = Mock()
        old_message_user = SubscriptionAdmin.message_user
        SubscriptionAdmin.message_user = mock
        self.model_admin.mark_has_paid(None, queryset)
        SubscriptionAdmin.message_user = old_message_user

        return mock
Ejemplo n.º 5
0
 def setUp(self):
     """Should send a message to the user"""
     Subscription.objects.create(name='Ronaldo',
                                 cpf='12345678912',
                                 email='*****@*****.**',
                                 phone='11-2134-4861')
     self.model_admin = SubscriptionAdmin(Subscription, admin.site)
Ejemplo n.º 6
0
    def setUp(self):
        # Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Marcos Ribeiro',
                                    cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 7
0
    def setUp(self):
        # Instance a Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Populate the database
        Subscription.objects.create(name='Regis da Silva',
                                    cpf='00000000000',
                                    email='*****@*****.**')
Ejemplo n.º 8
0
    def setUp(self):
        # Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Leandro Silva',
                                    cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 9
0
    def setUp(self):
        # Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Henrique Bastos',
                                    cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 10
0
    def setUp(self):
        # Instancia a ModelAdmin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Artur Sousa',
                                    cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 11
0
    def setUp(self):
        #Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        #Popula o banco
        Subscription.objects.create(name='Fellipe Pinheiro',
                                    cpf='123456798901',
                                    email='*****@*****.**')
Ejemplo n.º 12
0
    def setUp(self):
        # Instancia o ModelAdmin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Thiago Dorneles',
                                    cpf='12345678901',
                                    email='thiagodornelesrs@gmail')
Ejemplo n.º 13
0
    def setUp(self):
        # Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Eduardo Batista',
                                    cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 14
0
    def setUp(self):
        Subscription.objects.create(
            name='Nome Fictício',
            cpf='12345678901',
            email='*****@*****.**',
            phone='21-987654321'
        )

        self.model_admin = SubscriptionAdmin(Subscription, admin.site)
Ejemplo n.º 15
0
    def setUp(self):
        # Instacia Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        #Popula o banco
        Subscription.objects.create(
            name='Diekson Scardine',
            cpf='12345678901',
            email='*****@*****.**',
        )
Ejemplo n.º 16
0
    def setUp(self):
        #Instanciando o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        #Populando o banco
        Subscription.objects.create(
            name='Victor Novais',
            cpf='12345678910',
            email='*****@*****.**',
        )
Ejemplo n.º 17
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)
        Subscription.objects.create(name='Henrique Bastos', cpf='12345678901',email='*****@*****.**')

    def test_mark_all(self):
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)
        self.assertEqual(1, Subscription.objects.filter(paid=True).count())

    def test_has_action(self):
        self.assertIn('mark_as_paid', self.model_admin.actions)
Ejemplo n.º 18
0
 def setUp(self):
     # Instancia o ModelAdmin
     self.model_admin = SubscriptionAdmin(Subscription, admin.site)
     
     #Popula o Banco
     Subscription.objects.create(name='Hugo Silva', cpf='00000000001',
                                 email='*****@*****.**')
		def setUp(self):
			# Instancia o model Admin.
			self.model_admin = SubscriptionAdmin(Subscription, admin.site)

			# Popula o banco.
			Subscription.objects.create(name='Alexsander Falcucci', cpf='12345678901',
										email='*****@*****.**')
Ejemplo n.º 20
0
    def setUp(self):
        'Instancia o Model Admin'
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        Subscription.objects.create(name='Mauricio Sipmann',
                                    cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 21
0
	def setUp(self):
		#Instancia o Model Admin
		self.model_admin = SubscriptionAdmin(Subscription, admin.site)

		#Popula o banco
		Subscription.objects.create(name='Fellipe Pinheiro', cpf='123456798901',
									email='*****@*****.**')
Ejemplo n.º 22
0
    def setUp(self):
        # Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Marcos Ribeiro', cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 23
0
    def setUp(self):
        # Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Dyego Cantu', cpf='12345678901', \
                email='*****@*****.**')
Ejemplo n.º 24
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)
        Subscription.objects.create(name=u'Élysson MR', cpf='12345678901', email='*****@*****.**')

    def test_has_action(self):
        'Action is not installed.'
        self.assertIn('mark_as_paid', self.model_admin.actions)

    def test_mark_all(self):
        'Everyone must be marked as paid'
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)

        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 25
0
    def setUp(self):
        # Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o Banco
        Subscription.objects.create(name='Bruno Nascimento', cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 26
0
 def setUp(self):
     #instanciar o Model Admin
     self.model_admin = SubscriptionAdmin(Subscription, admin.site)
     
     #popula o banco
     Subscription.objects.create(name='Diego Tolentino',cpf='01234567890', 
                                 email='*****@*****.**')
Ejemplo n.º 27
0
 def setUp(self):
     self.model_admin = SubscriptionAdmin(Subscription, admin.site)
     Subscription.objects.create(
             name='Fulano de Tal',
             cpf='12345678901',
             email='*****@*****.**',
     )
Ejemplo n.º 28
0
 def setUp(self):
     # Instancia o Model Admin
     self.model_admin = SubscriptionAdmin(Subscription, admin.site)
     # Popula o banco
     Subscription.objects.create(
         name='Henrique Bastos', cpf='12345678901', email='*****@*****.**'
     )
Ejemplo n.º 29
0
    def setUp(self):
        # Instancia a ModelAdmin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Artur Sousa', cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 30
0
    def setUp(self):
        # Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Márcio Ramos Corrêa',
            cpf='12345678901', email='*****@*****.**')
Ejemplo n.º 31
0
    def setUp(self):
        # Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Guilherme Marostica', cpf='12345678998',
                                    email='*****@*****.**')
Ejemplo n.º 32
0
    def setUp(self):
        # Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Eduardo Batista', cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 33
0
	def setUp(self):
		# Intancia o Model Admin
		self.model_admin = SubscriptionAdmin(Subscription, admin.site)

		# Popula o banco
		Subscription.objects.create(name='Robinson Santos', cpf='12345678901',
									email='*****@*****.**')
Ejemplo n.º 34
0
    def setUp(self):
        # Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Darlene Medeiros', cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 35
0
class MarkPaidTest(TestCase):
	def setUp(self):		
		self.model_admin = SubscriptionAdmin(Subscription, admin.site)
		
		#popula o banco
		Subscription.objects.create(name='Dyesten Paulon', cpf='12345678901', email="*****@*****.**")
	
	def test_has_action(self):
		self.assertIn('mark_as_paid', self.model_admin.actions)
	
	def test_mark_all(self):
		fake_request = Mock()
		queryset = Subscription.objects.all()
		self.model_admin.mark_as_paid(fake_request, queryset)
		
		self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 36
0
    def setUp(self):
        #Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        #Popula o banco
        Subscription.objects.create(name='Joao guedes', cpf='12345678901',
                                    email='*****@*****.**')
Ejemplo n.º 37
0
	def setUp(self):
		#Instancia o Model Admin
		self.model_admin = SubscriptionAdmin(Subscription, admin.site)

		#Popula o banco
		Subscription.objects.create(name='Fernando', cpf='40090038800',
			email='*****@*****.**')
Ejemplo n.º 38
0
class MarkAsPaid(TestCase):
	def setUp(self):
		self.model_admin = SubscriptionAdmin(Subscription, admin.site)

		Subscription.objects.create(name='Eduardo', cpf='11122233345', email='*****@*****.**')

	def test_has_action(self):
		self.assertIn('mark_as_paid', self.model_admin.actions)

	def test_mark_all(self):
		fake_request = Mock()

		obj = Subscription.objects.create(name='edu', cpf='12345678901', email='*****@*****.**')
		queryset = Subscription.objects.filter(pk=obj.pk)
		self.model_admin.mark_as_paid(fake_request, queryset)

		self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 39
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        # instancia a model admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)
        # Popula o banco
        Subscription.objects.create(name="Rafael Francischini", cpf="12345678901", email="Rafael Francischini")

    def test_has_action(self):
        "Action is installed"
        self.assertIn("mark_as_paid", self.model_admin.actions)

    def test_mark_all(self):
        "Mark all as paid"
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)
        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
	def setUp(self):
		# Instancia o Model admin
		self.model_admin = SubscriptionAdmin(Subscription, admin.site)

		# Popula o banco
		Subscription.objects.create(name='Marcelo Dias',
									cpf='12345678901',
									email='*****@*****.**')
Ejemplo n.º 41
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        # Instancia o ModelAdmin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)
        
        #Popula o Banco
        Subscription.objects.create(name='Hugo Silva', cpf='00000000001',
                                    email='*****@*****.**')
    def test_has_action(self):
        'Action is installed'
        self.assertIn('mark_as_paid', self.model_admin.actions)
    
    def test_mark_all(self):
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)
        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 42
0
    def setUp(self):
        # Instancia o ModelAdmin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Thiago Dorneles',
                                    cpf='12345678901',
                                    email='thiagodornelesrs@gmail')
Ejemplo n.º 43
0
class MarkAsPaidTest(TestCase):
	def setUp(self):
		# Instancia o Model Admin
		self.model_admin = SubscriptionAdmin(Subscription, admin.site)
		# Popula o banco
		Subscription.objects.create(name='Henrique Bastos', cpf='12345678901', email='*****@*****.**')

	def test_has_action(self):
		'Action is installed'
		self.assertIn('mark_as_paid', self.model_admin.actions)

	def test_mark_all(self):
		'Mark all as paid.'
		fake_request = Mock()
		queryset = Subscription.objects.all()
		self.model_admin.mark_as_paid(fake_request, queryset)
		self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 44
0
    def setUp(self):
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        Subscription.objects.create(
            name='Fellipe Castro',
            cpf='12345678901',
            email='*****@*****.**'
        )
Ejemplo n.º 45
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)
        Subscription.objects.create(name=u'Élysson MR',
                                    cpf='12345678901',
                                    email='*****@*****.**')

    def test_has_action(self):
        'Action is not installed.'
        self.assertIn('mark_as_paid', self.model_admin.actions)

    def test_mark_all(self):
        'Everyone must be marked as paid'
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)

        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 46
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        # Instância do model admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)
        Subscription.objects.create(name='Matheus', cpf='99999999999',
                                    email='*****@*****.**')

    def test_has_action(self):
        """ Action is installed """
        self.assertIn('mark_as_paid', self.model_admin.actions)

    def test_mark_all_paid(self):
        """ Mark all as paid """
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)

        self.assertEquals(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 47
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        # Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Márcio Ramos Corrêa',
            cpf='12345678901', email='*****@*****.**')

    def test_has_action(self):
        'Action is installed'
        self.assertIn('mark_as_paid', self.model_admin.actions)

    def test_mark_all(self):
        'Mark all as paid.'
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)
Ejemplo n.º 48
0
class MarkAsPaidTest(TestCase):
	def setUp(self):
		# Instancia o Model Admin
		self.model_admin = SubscriptionAdmin(Subscription, admin.site)
		# Popula o banco
		Subscription.objects.create(name='Vitor Hugo Campos', cpf='12345678901',
		email='*****@*****.**')

	def test_has_action(self):
		'Action is installed'
		self.assertIn('mark_as_paid', self.model_admin.actions)

	def test_mark_all(self):
		'Mark all as paid.'
		fake_request = Mock()
		queryset = Subscription.objects.all()
		self.model_admin.mark_as_paid(fake_request, queryset)
		self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 49
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        Subscription.objects.create(name='Fellipe Castro',
                                    cpf='12345678901',
                                    email='*****@*****.**')

    def test_has_action(self):
        'Action is installed'
        self.assertIn('mark_as_paid', self.model_admin.actions)

    def test_mark_all(self):
        'Mark all as paid.'
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)

        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 50
0
class MarkAsPaid(TestCase):
    def setUp(self):
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)
        Subscription.objects.create(name='Filipe Manuel',
                                    cpf='06616141403',
                                    email='*****@*****.**',
                                    phone='82-96427829')

    def test_has_action(self):
        """
        Action is created
        """
        self.assertIn('mark_as_paid', self.model_admin.actions)

    def test_mark_all(self):
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)

        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 51
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        'Instancia o Model Admin'
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        Subscription.objects.create(name='Mauricio Sipmann',
                                    cpf='12345678901',
                                    email='*****@*****.**')

    def test_has_action(self):
        'Action esta instalada'
        self.assertIn('mark_as_paid', self.model_admin.actions)

    def test_mark_all(self):
        'Marca todos como pago'
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)

        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 52
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        # Instancia o Model admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        Subscription.objects.create(name='Ivan Rocha',
                                    cpf='12345678901',
                                    email='*****@*****.**')

    def test_has_action(self):
        'Action is installed.'
        self.assertIn('mark_as_paid', self.model_admin.actions)

    def test_mark_all(self):
        'Mark all as paid.'
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)

        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 53
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        # Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='Marcos Ribeiro',
                                    cpf='12345678901',
                                    email='*****@*****.**')

    def test_has_action(self):
        'Action esta instalada'
        self.assertIn('mark_as_paid', self.model_admin.actions)

    def test_mark_all(self):
        'Marca tudo como pago'
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)

        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 54
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        # Instance a Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Populate the database
        Subscription.objects.create(name='Regis da Silva',
                                    cpf='00000000000',
                                    email='*****@*****.**')

    def test_has_action(self):
        'Action is installed.'
        self.assertIn('mark_as_paid', self.model_admin.actions)

    def test_mark_all(self):
        'Mark all as paid.'
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)

        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 55
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        # Instacia Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        #Popula o banco
        Subscription.objects.create(
            name='Diekson Scardine',
            cpf='12345678901',
            email='*****@*****.**',
        )

    def test_has_action(self):
        'Action is installed.'
        self.assertIn('mark_as_paid', self.model_admin.actions)

    def test_mark_all(self):
        'Mark all as Paid'
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)

        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 56
0
class MarkAsPaidTest(TestCase):
    def setUp(self):
        #Instanciando o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        #Populando o banco
        Subscription.objects.create(
            name='Victor Novais',
            cpf='12345678910',
            email='*****@*****.**',
        )

    def test_has_action(self):
        'Admin must contain actions'
        self.assertIn('mark_as_paid', self.model_admin.actions)

    def test_mark_all(self):
        'Mark all as paid'
        fake_request = Mock()
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)

        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
Ejemplo n.º 57
0
 def setUp(self):
     self.model_admin = SubscriptionAdmin(Subscription, admin.site)
     Subscription.objects.create(name=u'Élysson MR',
                                 cpf='12345678901',
                                 email='*****@*****.**')
Ejemplo n.º 58
0
 def setUp(self):
     self.model_admin = SubscriptionAdmin(Subscription, admin.site)
     Subscription.objects.create(name='Filipe Manuel',
                                 cpf='06616141403',
                                 email='*****@*****.**',
                                 phone='82-96427829')
Ejemplo n.º 59
0
 def setUp(self):
     # Instância do model admin
     self.model_admin = SubscriptionAdmin(Subscription, admin.site)
     Subscription.objects.create(name='Matheus', cpf='99999999999',
                                 email='*****@*****.**')
Ejemplo n.º 60
0
    def setUp(self):
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        Subscription.objects.create(name='Fellipe Castro',
                                    cpf='12345678901',
                                    email='*****@*****.**')