Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Unit Tests #488

Closed
vigneshhari opened this issue Oct 3, 2020 · 8 comments
Closed

Fix Unit Tests #488

vigneshhari opened this issue Oct 3, 2020 · 8 comments
Labels
bug Something isn't working
Projects

Comments

@vigneshhari
Copy link
Member

All Unit Tests are broken, we need better unit testing with more edge cases on core functionality including permission scoping tests.

@vigneshhari vigneshhari added the help wanted Extra attention is needed label Oct 3, 2020
@issue-label-bot issue-label-bot bot added the bug Something isn't working label Oct 3, 2020
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.87. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@millefalcon
Copy link

Hello, i would like to try this out. Any pointers on where i should get started ?

@vigneshhari
Copy link
Member Author

Hi, we have a lot of breaking unit tests, you can start with those, and then later on we can write more unit tests and check more edge cases.

@millefalcon
Copy link

millefalcon commented Oct 5, 2020

Sure. I am bit confused about where these users and facilities are created. Or are they created using some sample data. Is there any get started guide i could look at ? Apologies for the noob question. This is what i see, after i have run the dev (i changed the config a bit for it find the static files) server.

care

@vigneshhari
Copy link
Member Author

You can send an email at vichuhari100@gmail.com and we can schedule a call to explain the code a bit.

@millefalcon
Copy link

Sure. Thanks :)

@millefalcon
Copy link

millefalcon commented Oct 6, 2020

So, i started going through some tests, and for one of the test for ex: care.facility.tests.test_patient_sample_api.TestPatientSampleApi, i found that the facility is not bound with the patient hence the patients failcity attribute become None and it fails the test with AttributeError: 'NoneType' object has no attribute 'external_id'.

...
 def get_sample_data(self, **kwargs):
        patient = kwargs.get("patient", self.patient)
        consultation = kwargs.get("consultation", self.consultation)
        return {
            "patient": str(patient.external_id),
            "consultation": str(consultation.external_id),
            "sample_type": "BA/ETA",
            "testing_facility": str(patient.facility.external_id),
        }
...

Should that been "testing_facility": str(consulation.facility.external_id), instead of "testing_facility": str(patient.facility.external_id),. I think, i need to read through once more :)

How should one handle this ? Any thoughts ?

@gigincg gigincg added this to Up next in Care Oct 22, 2021
@sainak
Copy link
Member

sainak commented Jun 7, 2022

Closing in favour of #794

@sainak sainak closed this as completed Jun 7, 2022
@sainak sainak removed the help wanted Extra attention is needed label Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Care
Up next
Development

No branches or pull requests

3 participants