Hi

When I run tests on my app they run through fine.

When I run tests just using "manage.py test" the app mentioned above 
contains failures.

Example code:

    def test_lumpsum_get_absolute_url(self):
        lumpsum = LumpSum.objects.get()
        self.assertEquals(lumpsum.get_absolute_url(),
                          reverse('estates:lumpsum', kwargs={
                              'case_pk': self.case.pk,
                              'client_pk': self.client.pk,
                              })
                          )


Traceback (most recent call last):
  File "path\test_models.py", line 541, in test_lumpsum_get_absolute_url
    'client_pk': lumpsum.client.pk,
AssertionError: '/estates/53/lumpsum/98/' != '/estates/113/lumpsum/98/'
- /estates/53/lumpsum/98/
?          ^
+ /estates/113/lumpsum/98/
?  

The case.pk (53 and 113 above) changes, yet the client.pk (98) does not.

I understand that setUp is run for each test, so expect the pk to rise, but 
I cannot fathom why only one of the PKs is changing.

In setUp:

self.case = Case.objects.create(
name='example case',
adviser=self.adviser,
meeting_date='2018-01-01',
urgency='N',
assignment_trust='N',
expression_wishes='N',
lifetime_planning='N',
home_savings='Y',
marriage_death='N',
inheritance_tax='Y',
inheritance_creditors='N',
inheritance_divorce='Y',
further_iht='N',
comment='just another comment',
)

self.client = Client.objects.create(
case=self.case,
prefix='Mr',
first_name='first name',
last_name='last name',
date_of_birth='1900-01-01',
gender='M',
residence='EN',
address_1='10 C',
city='city',
postcode='SOL',
telephone='0211 111111',
marital_status='SI',
have_will='N',
existing_poa='N',
dependant='N',
share_house='N',
)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/05ea3e16-0cba-446c-8166-00454ded503e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to