generated from jric11/baseProject
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import re
|
||||
from lxml import html
|
||||
from application_harness import Application
|
||||
app=Application();checks=0
|
||||
def check(ok,message):
|
||||
@@ -21,11 +22,11 @@ try:
|
||||
check(b'Own reversed receipt' in body and b'OWN-RECEIPT-32' in body,'Payment history preserves reversed receipts and their reasons')
|
||||
check(b'<script>unsafe</script>' in body and b'<script>unsafe</script>' not in body,'Correction reasons are escaped safely')
|
||||
check(b'NEIGHBOR-PRIVATE' not in body and b'FOREIGN-PRIVATE' not in body,'Selected member summary excludes neighboring members and other clubs')
|
||||
check(body.count(b'OWN-RECEIPT-')==25 and b'31 records.' in body and b'32 records.' in body,'Member dues and payment histories are bounded and counted independently')
|
||||
check(html.fromstring(body).xpath('//h2[normalize-space(.)="Payment history"]/following-sibling::div[1]//table')[0].text_content().count('OWN-RECEIPT-')==25 and b'31 records.' in body and b'32 records.' in body,'Member dues and payment histories are bounded and counted independently')
|
||||
links=re.findall(rb'href="([^"]+)"',body)
|
||||
check(any(b'payments_page=2' in link and b'membership_serial='+str(ids['clubA_membera']).encode() in link and b'Roster.memberSummary' in link for link in links),'History pager links retain both club and membership scope')
|
||||
status,last,_=summary(ids['clubA'],ids['clubA_membera'],'&payments_page=9999&dues_page=9999')
|
||||
check(status==200 and last.count(b'OWN-RECEIPT-')==7 and b'Page 2 of 2' in last,'Final history pages are clamped and show only remaining records')
|
||||
check(status==200 and html.fromstring(last).xpath('//h2[normalize-space(.)="Payment history"]/following-sibling::div[1]//table')[0].text_content().count('OWN-RECEIPT-')==7 and b'Page 2 of 2' in last,'Final history pages are clamped and show only remaining records')
|
||||
check(b'$3,150.00' in last and b'$31.00' in last and b'$3,119.00' in last,'Summary totals remain identical on later history pages')
|
||||
check(summary(ids['clubB'],ids['clubA_membera'])[0]==404,'Membership IDs cannot be paired with another club')
|
||||
check(summary(ids['clubA'],'invalid')[0]==422,'Invalid membership identifiers are rejected')
|
||||
|
||||
Reference in New Issue
Block a user