コード例 #1
0
ファイル: stockonhand.py プロジェクト: ekush/commcare-hq
    def test_stock_on_hand_partial_report(self):
        add_products(self.loc1.sql_location, ["id", "dp", "fs", "md", "ff", "dx", "bp", "pc", "qi"])
        script = """
            5551234 > Hmk Id 400
            5551234 < {}
        """.format(SOH_PARTIAL_CONFIRM % {
            'contact_name': self.user1.full_name,
            'facility_name': self.loc1.name,
            'product_list': 'bp dp dx ff fs md pc qi'
        })
        self.run_script(script)
        script = """
            5551234 > Hmk Dp 569 ip 454 ff 5655
            5551234 < {}
        """.format(SOH_PARTIAL_CONFIRM % {
            'contact_name': self.user1.full_name,
            'facility_name': self.loc1.name,
            'product_list': 'bp dx fs md pc qi'
        })
        self.run_script(script)

        script = """
            5551234 > Hmk Bp 343 Dx 565 Fs 2322 Md 100 Pc 8778 Qi 34
            5551234 < %(soh_confirm)s
        """ % {"soh_confirm": unicode(SOH_CONFIRM)}
        self.run_script(script)
コード例 #2
0
ファイル: stockonhand.py プロジェクト: ekush/commcare-hq
    def test_product_aliases(self):

        add_products(self.loc1.sql_location, ["id", "dp", "ip"])
        script = """
            5551234 > Hmk iucd 400
            5551234 < {}
        """.format(SOH_PARTIAL_CONFIRM % {
            'contact_name': self.user1.full_name,
            'facility_name': self.loc1.name,
            'product_list': 'dp ip'
        })
        self.run_script(script)

        script = """
            5551234 > Hmk Depo 569
            5551234 < {}
        """.format(SOH_PARTIAL_CONFIRM % {
            'contact_name': self.user1.full_name,
            'facility_name': self.loc1.name,
            'product_list': 'ip'
        })
        self.run_script(script)

        script = """
            5551234 > Hmk IMPL 678
            5551234 < %(soh_confirm)s
        """ % {"soh_confirm": unicode(SOH_CONFIRM)}
        self.run_script(script)
コード例 #3
0
ファイル: stockonhand.py プロジェクト: ekush/commcare-hq
    def test_stock_on_hand_delimiters_extra_spaces(self):
        product_codes = ["fs", "md", "ff", "pc"]
        add_products(self.loc1.sql_location, product_codes)

        #extra spaces
        script = """
            5551234 > hmk fs  100   md    100     ff      100       pc        100
            5551234 < %(soh_confirm)s
        """ % {"soh_confirm": unicode(SOH_CONFIRM)}
        self.run_script(script)
コード例 #4
0
ファイル: stockonhand.py プロジェクト: ekush/commcare-hq
    def test_stock_on_hand_delimiters_commas(self):
        product_codes = ["fs", "md", "ff"]
        add_products(self.loc1.sql_location, product_codes)

        #commas
        script = """
            5551234 > hmk fs100,md100,ff100
            5551234 < %(soh_confirm)s
        """ % {"soh_confirm": unicode(SOH_CONFIRM)}
        self.run_script(script)
コード例 #5
0
ファイル: stockonhand.py プロジェクト: ekush/commcare-hq
    def test_stock_on_hand_delimiters_all_spaced_out(self):
        product_codes = ["fs", "md", "ff", "dx", "bp", "pc", "qi"]
        add_products(self.loc1.sql_location, product_codes)

        #all space delimited
        script = """
            5551234 > hmk fs 100 md 100 ff 100 dx 100 bp 100 pc 100 qi 100
            5551234 < %(soh_confirm)s
        """ % {"soh_confirm": unicode(SOH_CONFIRM)}
        self.run_script(script)
コード例 #6
0
ファイル: stockonhand.py プロジェクト: ekush/commcare-hq
    def test_stock_on_hand_mixed_delimiters_and_spacing(self):
        product_codes = ["fs", "md", "ff", "pc", "qi", "bp", "dx"]
        add_products(self.loc1.sql_location, product_codes)

        #mixed - commas, spacing
        script = """
            5551234 > hmk fs100 , md100,ff 100 pc  100  qi,       1000,bp, 100, dx,100
            5551234 < %(soh_confirm)s
        """ % {"soh_confirm": unicode(SOH_PARTIAL_CONFIRM) % {
            "contact_name": self.user1.full_name, "facility_name": self.loc1.name, "product_list": "bp dx qi"
        }}
        self.run_script(script)