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


Python SubscriptionAdmin.mark_as_paid方法代码示例

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


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

示例1: MarkAsPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
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,代码行数:32,代码来源:test_admin.py

示例2: MarkAsPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
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,代码行数:15,代码来源:test_admin.py

示例3: MarkPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
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,代码行数:18,代码来源:tests_admin.py

示例4: MarkAsPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
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,代码行数:18,代码来源:test_admin.py

示例5: MarkAsPaid

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
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,代码行数:19,代码来源:tests_admin.py

示例6: MarkAsPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
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())
开发者ID:rfunix,项目名称:wttd,代码行数:19,代码来源:test_admin.py

示例7: MarkAsPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
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='[email protected]')
    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())
开发者ID:hugoleodev,项目名称:wttd,代码行数:19,代码来源:test_admin.py

示例8: MarkAsPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
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='[email protected]')

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

示例9: MarkAsPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
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='[email protected]')

    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(spec=HttpRequest, _messages=Mock())
        queryset = Subscription.objects.all()
        self.model_admin.mark_as_paid(fake_request, queryset)
        self.assertEqual(1, Subscription.objects.filter(paid=True).count())
开发者ID:ricardobfreitas,项目名称:eventex,代码行数:20,代码来源:test_admin.py

示例10: MarkAsPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
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='[email protected]')

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

示例11: MarkPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
class MarkPaidTest(TestCase):
    def setUp(self):
        # instancia o model admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        # Popula o banco
        Subscription.objects.create(name='AdeilsonT', cpf='123456789022', email='[email protected]')

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

示例12: MarkAsPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
class MarkAsPaidTest(TestCase):
    
    def setUp(self):
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)
        Subscription.objects.create(name='Rafael Cassau',
                                    cpf='11111111111',
                                    email='[email protected]')
    
    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())
开发者ID:rafaelcassau,项目名称:curso-welcometothedjango,代码行数:21,代码来源:test_admin.py

示例13: MarkAsPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
class MarkAsPaidTest(TestCase):
	def setUp(self):
		#Instancia o Model Admin
		self.model_admin = SubscriptionAdmin(Subscription, admin.site)

		Subscription.objects.create(name='Marcos Dias', cpf='12345678901',
									email='[email protected]')

	def test_has_action(self):
		"""Action 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())
开发者ID:MarcosDias,项目名称:WTTD,代码行数:21,代码来源:test_admin.py

示例14: MarkAsPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
class MarkAsPaidTest(TestCase):
    def setUp(self):
        #Instancia o Model Admin
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)

        #Popula o BD
        Subscription.objects.create(name='Gil', cpf='23423299988', email='[email protected]')

    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 test_has_action(self):
        'Action is Installed'
        self.assertIn('mark_as_paid', self.model_admin.actions)
开发者ID:linuxsoares,项目名称:eventex-gilmar,代码行数:21,代码来源:test_admin.py

示例15: MarkAsPaidTest

# 需要导入模块: from eventex.subscriptions.admin import SubscriptionAdmin [as 别名]
# 或者: from eventex.subscriptions.admin.SubscriptionAdmin import mark_as_paid [as 别名]
class MarkAsPaidTest(TestCase):
    def setUp(self):
        self.model_admin = SubscriptionAdmin(Subscription, admin.site)
        Subscription.objects.create(
                name='Fulano de Tal',
                cpf='12345678901',
                email='[email protected]',
        )

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


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