RikSchoonbeek / crypto-prices

0 stars 0 forks source link

Rewrite management commands TEST DRIVEN #6

Open RikSchoonbeek opened 5 years ago

RikSchoonbeek commented 5 years ago

Rewrite m commands test driven way

RikSchoonbeek commented 5 years ago

Now going to work on save_available_exchange_currencies

RikSchoonbeek commented 5 years ago
RikSchoonbeek commented 5 years ago

Now:

was working on get_data_from_exchange_api function in save_available_exchange_currencies_utils.py

and simultaneously on the method(s) that will test it

RikSchoonbeek commented 5 years ago

write tests for:

RikSchoonbeek commented 5 years ago

write test for:

RikSchoonbeek commented 5 years ago

I have written tests for everything that can be tested.

didn't write tests for:

RikSchoonbeek commented 5 years ago

Now I want to run save_available_exchange_currencies

but I still get errors

RikSchoonbeek commented 5 years ago

It seems that the TickerSymbol symbols aren't unique.

Some currencies have the same symbols

Like: KEY HOT

So, I need to adjust my code in such a way that TickerSymbol.symbol doesn't have to be unique.

RikSchoonbeek commented 5 years ago

NOW

TickerSymbol Removed unique=True from symbol Added unique_together = [['symbol', 'currency']]

Nu proberen of save_coinapi_assets kan lopen Just did, but gave error.

Also check previous comment

RikSchoonbeek commented 5 years ago

I am changing save_coinapi_assets, have rewritten a few things. Now it runs without error, but I am getting an unexpected result.

When save_coinapi_assets has finished, there are more TickerSymbol instances in the database than there are Currencies, which is weird, because there should be an equal amount.

Maybe it's not necessary to have Currency and TickerSymbol separate, and maybe I can just have ticker_symbol as a column in the Currency table.

RikSchoonbeek commented 5 years ago

Since I removed the TickerSymbol model, and changed the Currency model, I need to adjust the files for save_available_exchange_currencies as well

RikSchoonbeek commented 5 years ago

adjusted in save_available_exchange_currencies:

RikSchoonbeek commented 5 years ago

NOW Trying to get

save_available_exchange_currencies to work, I think I have adjusted all the files in save_available_exchange_currencies_utils, and now I am trying to update the test for it.

I was running the test, but I get an error I don't understand yet.