本文整理汇总了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())
示例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)
示例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]')
示例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]')
示例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())
示例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]')
示例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())
示例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]')
示例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]')
示例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]')
示例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]')
示例12: setUp
def setUp(self):
self.model_admin = SubscriptionAdmin(Subscription, admin.site)
Subscription.objects.create(
name='Fulano de Tal',
cpf='12345678901',
email='[email protected]',
)
示例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]')
示例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]')
示例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())