def test_model_can_be_saved(): generate_standard_set() member = MemberFactory() transaction = TransactionFactory(owner=member) ns = NotificationSent(email=member.email, transaction_unique_id=transaction.unique_id) ns.save() assert ns.pk > 0
def test_get_member_list_json(admin_client): # Make sure we have at least one... member = MemberFactory() response = admin_client.get( '/api/members/', content_type='application/json' ) result = json.loads(response.content.decode('utf-8')) assert result['count'] > 0
def generate_all(): with transaction.atomic(): members.tests.fixtures.types.generate_standard_set() members.tests.fixtures.tags.generate_standard_set() MemberFactory.create_batch(100) MembershipApplicationFactory.create_batch(25) tokentypes.generate_standard_set() accesstypes.generate_standard_set() NonMemberTokenFactory.create_batch(10) creditor.tests.fixtures.tags.generate_standard_set() Membershipfee4all() TransactionFactory.build_batch(100) MemberNoteFactory.create_batch(50) TokenFactory.create_batch(50) GrantFactory.create_batch(50) for m in Member.objects.filter(access_granted__atype=AccessType.objects.get(bit=0)): KeyholderfeeFactory(owner=m) for t in RecurringTransaction.objects.all(): ret = t.conditional_add_transaction()
def generate_all(): with transaction.atomic(): members.tests.fixtures.types.generate_standard_set() members.tests.fixtures.tags.generate_standard_set() MemberFactory.create_batch(100) MembershipApplicationFactory.create_batch(25) tokentypes.generate_standard_set() accesstypes.generate_standard_set() NonMemberTokenFactory.create_batch(10) creditor.tests.fixtures.tags.generate_standard_set() Membershipfee4all() TransactionFactory.build_batch(100) MemberNoteFactory.create_batch(50) TokenFactory.create_batch(50) GrantFactory.create_batch(50) for m in Member.objects.filter( access_granted__atype=AccessType.objects.get(bit=0)): KeyholderfeeFactory(owner=m) for t in RecurringTransaction.objects.all(): ret = t.conditional_add_transaction()
def test_get_admin_members_list(admin_client): # Create a test member member = MemberFactory() response = admin_client.get('/admin/members/member/') assert member.email in response.content.decode('utf-8')
def handle(self, *args, **options): for i in range(options['amount']): MemberFactory()
def basic_setup(): generate_standard_set() member = MemberFactory() return member