1654 |
1654 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1655 |
1655 |
mocked_post.side_effect = [READ_FAMILY, UPDATE_FAMILY]
|
1656 |
1656 |
url = get_endpoint('create-person')
|
1657 |
1657 |
params = {
|
1658 |
1658 |
'civility': None,
|
1659 |
1659 |
'firstname': 'Mathias',
|
1660 |
1660 |
'lastname': 'Cassel',
|
1661 |
1661 |
'quality': 'O',
|
|
1662 |
'sexe': 'M',
|
1662 |
1663 |
'dateBirth': '1972-01-01',
|
1663 |
1664 |
'contact/phone': None,
|
1664 |
1665 |
'contact/mobile': '0623456789',
|
1665 |
1666 |
'contact/mail': None,
|
1666 |
1667 |
}
|
1667 |
1668 |
|
1668 |
1669 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1669 |
1670 |
resp = app.post_json(url + '?NameID=local', params=params)
|
... | ... | |
1673 |
1674 |
|
1674 |
1675 |
def test_create_person_not_linked_error(con, app):
|
1675 |
1676 |
url = get_endpoint('create-person')
|
1676 |
1677 |
params = {
|
1677 |
1678 |
'civility': None,
|
1678 |
1679 |
'firstname': 'Mathias',
|
1679 |
1680 |
'lastname': 'Cassel',
|
1680 |
1681 |
'quality': 'O',
|
|
1682 |
'sexe': 'M',
|
1681 |
1683 |
'dateBirth': '1972-01-01',
|
1682 |
1684 |
'contact/phone': None,
|
1683 |
1685 |
'contact/mobile': '0623456789',
|
1684 |
1686 |
'contact/mail': None,
|
1685 |
1687 |
}
|
1686 |
1688 |
|
1687 |
1689 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1688 |
1690 |
assert resp.json['err'] == 'not-linked'
|
... | ... | |
1695 |
1697 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1696 |
1698 |
mocked_post.side_effect = [READ_FAMILY, UPDATE_FAMILY]
|
1697 |
1699 |
url = get_endpoint('update-person')
|
1698 |
1700 |
params = {
|
1699 |
1701 |
'civility': None,
|
1700 |
1702 |
'firstname': 'Mathias',
|
1701 |
1703 |
'lastname': 'Cassel',
|
1702 |
1704 |
'quality': 'O',
|
|
1705 |
'sexe': 'M',
|
1703 |
1706 |
'dateBirth': '1972-01-01',
|
1704 |
1707 |
'contact/phone': None,
|
1705 |
1708 |
'contact/mobile': '0623456789',
|
1706 |
1709 |
'contact/mail': None,
|
1707 |
1710 |
}
|
1708 |
1711 |
|
1709 |
1712 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1710 |
1713 |
resp = app.post_json(url + '?NameID=local&person_id=614059', params=params)
|
... | ... | |
1714 |
1717 |
|
1715 |
1718 |
def test_update_person_not_linked_error(con, app):
|
1716 |
1719 |
url = get_endpoint('update-person')
|
1717 |
1720 |
params = {
|
1718 |
1721 |
'civility': None,
|
1719 |
1722 |
'firstname': 'Mathias',
|
1720 |
1723 |
'lastname': 'Cassel',
|
1721 |
1724 |
'quality': 'O',
|
|
1725 |
'sexe': 'M',
|
1722 |
1726 |
'dateBirth': '1972-01-01',
|
1723 |
1727 |
'contact/phone': None,
|
1724 |
1728 |
'contact/mobile': '0623456789',
|
1725 |
1729 |
'contact/mail': None,
|
1726 |
1730 |
}
|
1727 |
1731 |
|
1728 |
1732 |
resp = app.post_json(url + '?NameID=local&person_id=614059', params=params)
|
1729 |
1733 |
assert resp.json['err'] == 'not-linked'
|
... | ... | |
1736 |
1740 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1737 |
1741 |
mocked_post.side_effect = [READ_FAMILY]
|
1738 |
1742 |
url = get_endpoint('update-person')
|
1739 |
1743 |
params = {
|
1740 |
1744 |
'civility': None,
|
1741 |
1745 |
'firstname': 'Mathias',
|
1742 |
1746 |
'lastname': 'Cassel',
|
1743 |
1747 |
'quality': 'O',
|
|
1748 |
'sexe': 'M',
|
1744 |
1749 |
'dateBirth': '1972-01-01',
|
1745 |
1750 |
'contact/phone': None,
|
1746 |
1751 |
'contact/mobile': '0623456789',
|
1747 |
1752 |
'contact/mail': None,
|
1748 |
1753 |
}
|
1749 |
1754 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1750 |
1755 |
resp = app.post_json(url + '?NameID=local&person_id=000000', params=params)
|
1751 |
1756 |
assert resp.json['err'] == 'not-found'
|
... | ... | |
1791 |
1796 |
def test_create_child_person(mocked_post, mocked_get, con, app):
|
1792 |
1797 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1793 |
1798 |
mocked_post.side_effect = [READ_FAMILY, UPDATE_CHILD_AUTO]
|
1794 |
1799 |
url = get_endpoint('create-child-person')
|
1795 |
1800 |
params = {
|
1796 |
1801 |
'personInfo/civility': 'MME',
|
1797 |
1802 |
'personInfo/firstname': 'Diana',
|
1798 |
1803 |
'personInfo/lastname': 'Ross',
|
|
1804 |
'personInfo/sexe': 'F',
|
1799 |
1805 |
'personInfo/dateBirth': '1944-03-26',
|
1800 |
1806 |
'personInfo/contact/phone': '0199999999',
|
1801 |
1807 |
'personInfo/contact/mobile': '0723456789',
|
1802 |
1808 |
'personInfo/contact/mail': 'dross@example.org',
|
1803 |
1809 |
'personQuality/code': 'TUTEUR',
|
1804 |
1810 |
}
|
1805 |
1811 |
|
1806 |
1812 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
... | ... | |
1810 |
1816 |
|
1811 |
1817 |
|
1812 |
1818 |
def test_create_child_person_not_linked_error(con, app):
|
1813 |
1819 |
url = get_endpoint('create-child-person')
|
1814 |
1820 |
params = {
|
1815 |
1821 |
'personInfo/civility': 'MME',
|
1816 |
1822 |
'personInfo/firstname': 'Diana',
|
1817 |
1823 |
'personInfo/lastname': 'Ross',
|
|
1824 |
'personInfo/sexe': 'F',
|
1818 |
1825 |
'personInfo/dateBirth': '1944-03-26',
|
1819 |
1826 |
'personInfo/contact/phone': '01999999999',
|
1820 |
1827 |
'personInfo/contact/mobile': '0723456789',
|
1821 |
1828 |
'personInfo/contact/mail': 'dross@example.org',
|
1822 |
1829 |
'personQuality/code': 'TUTEUR',
|
1823 |
1830 |
}
|
1824 |
1831 |
|
1825 |
1832 |
resp = app.post_json(url + '?NameID=local&child_id=613880', params=params)
|
... | ... | |
1832 |
1839 |
def test_create_child_person_no_child_error(mocked_post, mocked_get, con, app):
|
1833 |
1840 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1834 |
1841 |
mocked_post.side_effect = [READ_FAMILY]
|
1835 |
1842 |
url = get_endpoint('create-child-person')
|
1836 |
1843 |
params = {
|
1837 |
1844 |
'personInfo/civility': 'MME',
|
1838 |
1845 |
'personInfo/firstname': 'Diana',
|
1839 |
1846 |
'personInfo/lastname': 'Ross',
|
|
1847 |
'personInfo/sexe': 'F',
|
1840 |
1848 |
'personInfo/dateBirth': '1944-03-26',
|
1841 |
1849 |
'personInfo/contact/phone': '01999999999',
|
1842 |
1850 |
'personInfo/contact/mobile': '0723456789',
|
1843 |
1851 |
'personInfo/contact/mail': 'dross@example.org',
|
1844 |
1852 |
'personQuality/code': 'TUTEUR',
|
1845 |
1853 |
}
|
1846 |
1854 |
|
1847 |
1855 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
... | ... | |
1855 |
1863 |
def test_update_child_person(mocked_post, mocked_get, con, app):
|
1856 |
1864 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1857 |
1865 |
mocked_post.side_effect = [READ_FAMILY, UPDATE_FAMILY]
|
1858 |
1866 |
url = get_endpoint('update-child-person')
|
1859 |
1867 |
params = {
|
1860 |
1868 |
'personInfo/civility': 'M.',
|
1861 |
1869 |
'personInfo/firstname': 'Angelo',
|
1862 |
1870 |
'personInfo/lastname': 'Bent',
|
|
1871 |
'personInfo/sexe': 'M',
|
1863 |
1872 |
'personInfo/dateBirth': '1985-06-22',
|
1864 |
1873 |
'personInfo/contact/phone': '0102030405',
|
1865 |
1874 |
'personInfo/contact/mobile': None,
|
1866 |
1875 |
'personInfo/contact/mail': None,
|
1867 |
1876 |
'personQuality/code': 'O',
|
1868 |
1877 |
}
|
1869 |
1878 |
|
1870 |
1879 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1871 |
|
-
|