def test_000001_balance_sheet(): correct_timestamps = [ '2018-09-30', '2018-06-30', '2018-03-31', '2017-12-31', '2017-09-30', '2017-06-30', '2017-03-31', '2016-12-31', '2016-09-30', '2016-06-30', '2016-03-31', '2015-12-31', '2015-09-30', '2015-06-30', '2015-03-31', '2014-12-31', '2014-09-30', '2014-06-30', '2014-03-31', '2013-12-31', '2013-09-30', '2013-06-30', '2013-03-31', '2012-12-31', '2012-09-30', '2012-06-30', '2012-03-31', '2011-12-31', '2011-09-30', '2011-06-30', '2011-03-31', '2010-12-31', '2010-09-30', '2010-06-30', '2010-03-31', '2009-12-31', '2009-09-30', '2009-06-30', '2009-03-31', '2008-12-31', '2008-09-30', '2008-06-30', '2008-03-31', '2007-12-31', '2007-09-30', '2007-06-30', '2007-03-31', '2006-12-31', '2006-09-30', '2006-06-30', '2006-03-31', '2005-12-31', '2005-09-30', '2005-06-30', '2005-03-31', '2004-12-31', '2004-09-30', '2004-06-30', '2004-03-31', '2003-12-31', '2003-09-30', '2003-06-30', '2003-03-31', '2002-12-31', '2002-09-30', '2002-06-30', '2002-03-31', '2001-12-31', '2001-06-30', '2000-12-31', '2000-06-30', '1999-12-31', '1999-06-30', '1998-12-31', '1998-06-30', '1997-12-31', '1997-06-30', '1996-12-31', '1996-06-30', '1995-12-31', '1995-06-30', '1994-12-31', '1994-06-30', '1993-12-31', '1992-12-31', '1991-12-31', '1990-12-31', '1989-12-31' ] result = get_balance_sheet(session=session, provider='eastmoney', return_type='domain', codes=['000001'], end_timestamp='2018-12-30', order=BalanceSheet.report_date.desc(), time_field='report_date') assert len(correct_timestamps) == len(result) timestamps = [to_time_str(item.report_date) for item in result] assert set(correct_timestamps) == set(timestamps) latest: BalanceSheet = result[0] assert latest.fi_cash_and_deposit_in_central_bank == 287600000000 assert latest.fi_deposit_in_other_fi == 95310000000 assert latest.fi_expensive_metals == 72020000000 assert latest.fi_lending_to_other_fi == 88100000000 assert latest.fi_financial_assets_effect_current_income == 103500000000 assert latest.fi_financial_derivative_asset == 25650000000 assert latest.fi_buying_sell_back_fi__asset == 32760000000 assert latest.accounts_receivable == 22830000000 assert latest.fi_interest_receivable == 18310000000 assert latest.fi_disbursing_loans_and_advances == 1870000000000 assert latest.real_estate_investment == 194000000 assert latest.fixed_assets == 9374000000 assert latest.intangible_assets == 4722000000 assert latest.goodwill == 7568000000 assert latest.deferred_tax_assets == 28880000000 assert latest.fi_other_asset == 15630000000 assert latest.total_assets == 3350000000000 assert latest.fi_borrowings_from_central_bank == 149900000000 assert latest.fi_deposit_from_other_fi == 402300000000 assert latest.fi_borrowings_from_fi == 17830000000 assert latest.fi_financial_liability_effect_current_income == 9599000000 assert latest.fi_financial_derivative_liability == 20730000000 assert latest.fi_sell_buy_back_fi_asset == 2000000000 assert latest.fi_savings_absorption == 2130000000000 assert latest.fi_notes_payable == 0 assert latest.employee_benefits_payable == 10550000000 assert latest.taxes_payable == 7595000000 assert latest.interest_payable == 27670000000 assert latest.fi_estimated_liabilities == 24000000 assert latest.fi_bond_payable == 321500000000 assert latest.fi_other_liability == 12570000000 assert latest.total_liabilities == 3120000000000 assert latest.fi_capital == 17170000000 assert latest.fi_other_equity_instruments == 19950000000 assert latest.fi_preferred_stock == 19950000000 assert latest.capital_reserve == 56470000000 assert latest.surplus_reserve == 10780000000 assert latest.fi_generic_risk_reserve == 38550000000 assert latest.undistributed_profits == 91970000000 assert latest.equity == 235200000000 assert latest.total_liabilities_and_equity == 3350000000000
def test_000778_balance_sheet(): correct_timestamps = [ '2018-09-30', '2018-06-30', '2018-03-31', '2017-12-31', '2017-09-30', '2017-06-30', '2017-03-31', '2016-12-31', '2016-09-30', '2016-06-30', '2016-03-31', '2015-12-31', '2015-09-30', '2015-06-30', '2015-03-31', '2014-12-31', '2014-09-30', '2014-06-30', '2014-03-31', '2013-12-31', '2013-09-30', '2013-06-30', '2013-03-31', '2012-12-31', '2012-09-30', '2012-06-30', '2012-03-31', '2011-12-31', '2011-09-30', '2011-06-30', '2011-03-31', '2010-12-31', '2010-09-30', '2010-06-30', '2010-03-31', '2009-12-31', '2009-09-30', '2009-06-30', '2009-03-31', '2008-12-31', '2008-09-30', '2008-06-30', '2008-03-31', '2007-12-31', '2007-09-30', '2007-06-30', '2007-03-31', '2006-12-31', '2006-09-30', '2006-06-30', '2006-03-31', '2005-12-31', '2005-09-30', '2005-06-30', '2005-03-31', '2004-12-31', '2004-09-30', '2004-06-30', '2004-03-31', '2003-12-31', '2003-09-30', '2003-06-30', '2003-03-31', '2002-12-31', '2002-09-30', '2002-06-30', '2002-03-31', '2001-12-31', '2001-06-30', '2000-12-31', '2000-06-30', '1999-12-31', '1999-06-30', '1998-12-31', '1998-06-30', '1997-12-31', '1997-06-30', '1996-12-31', '1995-12-31', '1994-12-31' ] result = get_balance_sheet(session=session, provider='eastmoney', return_type='domain', codes=['000778'], end_timestamp='2018-12-30', order=BalanceSheet.report_date.desc(), time_field='report_date') assert len(correct_timestamps) == len(result) timestamps = [to_time_str(item.report_date) for item in result] assert set(correct_timestamps) == set(timestamps) latest: BalanceSheet = result[0] assert latest.cash_and_cash_equivalents == 6381000000 assert latest.note_receivable == 4655000000 assert latest.accounts_receivable == 1920000000 assert latest.advances_to_suppliers == 2112000000 assert latest.other_receivables == 4671000000 assert latest.inventories == 3891000000 assert latest.current_portion_of_non_current_assets == 270000000 assert latest.other_current_assets == 220100000 assert latest.total_current_assets == 24120000000 assert latest.fi_assets_saleable == 914900000 assert latest.long_term_receivables == 1078000000 assert latest.long_term_equity_investment == 6071000000 assert latest.real_estate_investment == 24130000 assert latest.fixed_assets == 15440000000 assert latest.construction_in_process == 1196000000 assert latest.intangible_assets == 853800000 assert latest.goodwill == 32990000 assert latest.long_term_prepaid_expenses == 2527000 assert latest.deferred_tax_assets == 292300000 assert latest.other_non_current_assets == 332800000 assert latest.total_assets == 50350000000 assert latest.short_term_borrowing == 9104000000 assert latest.accept_money_deposits == 0 assert latest.advances_from_customers == 3199000000 assert latest.employee_benefits_payable == 207800000 assert latest.taxes_payable == 735200000 assert latest.other_payable == 2022000000 assert latest.current_portion_of_non_current_liabilities == 1099000000 assert latest.other_current_liabilities == 1000000000 assert latest.total_current_liabilities == 24050000000 assert latest.long_term_borrowing == 914400000 assert latest.fi_bond_payable == 2992000000 assert latest.long_term_payable == 636800000 assert latest.deferred_tax_liabilities == 314800000 assert latest.other_non_current_liabilities == 127800000 assert latest.total_non_current_liabilities == 4986000000 assert latest.total_liabilities == 29040000000 assert latest.capital == 3991000000 assert latest.capital_reserve == 8688000000 assert latest.special_reserve == 40730000 assert latest.surplus_reserve == 1286000000 assert latest.undistributed_profits == 7236000000 assert latest.equity == 20320000000 assert latest.equity_as_minority_interest == 997400000 assert latest.total_equity == 21320000000 assert latest.total_liabilities_and_equity == 50350000000