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


Python admin.SubscriptionAdmin类代码示例

本文整理汇总了Python中eventex.subscriptions.admin.SubscriptionAdmin的典型用法代码示例。如果您正苦于以下问题:Python SubscriptionAdmin类的具体用法?Python SubscriptionAdmin怎么用?Python SubscriptionAdmin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: MarkAsPaidTest

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='[email protected]',
            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())
开发者ID:davivcgarcia,项目名称:wttd-15,代码行数:30,代码来源:test_admin.py

示例2: MarkAsPaidTest

class MarkAsPaidTest(TestCase):
    def setUp(self):
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)
        Subscription.objects.create(name='Henrique Bastos', cpf='12345678901',email='[email protected]')

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

示例3: setUp

		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='[email protected]')
开发者ID:alexfalcucc,项目名称:eventex-wttd-alexfalcucci,代码行数:7,代码来源:test_admin.py

示例4: setUp

    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='[email protected]')
开发者ID:joplen,项目名称:Eventex,代码行数:7,代码来源:test_admin.py

示例5: MarkAsPaidTest

class MarkAsPaidTest(TestCase):
    def setUp(self):
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)
        Subscription.objects.create(name=u'Élysson MR', cpf='12345678901', email='[email protected]')

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

示例6: setUp

	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='[email protected]')
开发者ID:robinsonsantos,项目名称:wttd,代码行数:7,代码来源:test_admin.py

示例7: MarkPaidTest

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="[email protected]")
	
	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())
开发者ID:dyesten,项目名称:wttd,代码行数:16,代码来源:tests_admin.py

示例8: setUp

 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='[email protected]')
开发者ID:hugoleodev,项目名称:wttd,代码行数:7,代码来源:test_admin.py

示例9: setUp

    def setUp(self):
        'Instancia o Model Admin'
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        Subscription.objects.create(name='Mauricio Sipmann',
                                    cpf='12345678901',
                                    email='[email protected]')
开发者ID:sipmann,项目名称:wttd,代码行数:7,代码来源:test_admin.py

示例10: setUp

	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='[email protected]')
开发者ID:fernandochimi,项目名称:wttd,代码行数:7,代码来源:test_admin.py

示例11: setUp

    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='[email protected]')
开发者ID:dyegocantu,项目名称:eventex-old,代码行数:7,代码来源:test_admin.py

示例12: setUp

 def setUp(self):
     self.model_admin = SubscriptionAdmin(Subscription, admin.site)
     Subscription.objects.create(
             name='Fulano de Tal',
             cpf='12345678901',
             email='[email protected]',
     )
开发者ID:marcelomd,项目名称:wttd,代码行数:7,代码来源:test_admin.py

示例13: setUp

 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='[email protected]')
开发者ID:diegotolentino,项目名称:eventex,代码行数:7,代码来源:test_admin.py

示例14: setUp

    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='[email protected]')
开发者ID:thiagodorneles,项目名称:WTTD,代码行数:8,代码来源:test_admin.py

示例15: MarkAsPaid

class MarkAsPaid(TestCase):
	def setUp(self):
		self.model_admin = SubscriptionAdmin(Subscription, admin.site)

		Subscription.objects.create(name='Eduardo', cpf='11122233345', email='[email protected]')

	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='[email protected]')
		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())
开发者ID:eduardo-matos,项目名称:wttd,代码行数:17,代码来源:tests_admin.py


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