def create_history_content(self):
        for index in range(1, 6):
            patient_test = Patient(id=index,
                                   age_range=index,
                                   classification='1')
            patient_test.save()

        staff = Staff(name='Atendente', id_user='******')
        staff.save()
 def test_manage_accounts_view(self, client):
     stafflogin = Staff.objects.create_superuser(**self.default_user_data())
     response = client.post('/login', {
         'username': '******',
         'password': "******"
     })
     staff1 = Staff(id_user='******')
     staff1.save()
     allstaff = [stafflogin, staff1]
     response = client.get('/accounts/')
     assert response.status_code == 200
     assert list(response.context['staffs']) == allstaff
 def test__str__(self):
     user_email = Staff(email='*****@*****.**')
     assert str(user_email) == '*****@*****.**'
 def test_has_perm(self):
     perm = None
     app_name = None
     user = Staff()
     assert user.has_perm(perm) is True
     assert user.has_module_perms(app_name) is True
 def test_get_short_name(self):
     name = "Carlinhos"
     user = Staff(name=name)
     assert user.get_short_name() == name
 def test_user_get_full_name(self):
     name = "Carlinhos Cabral"
     user = Staff(name=name)
     assert user.get_full_name() == name
    def test_edit_accounts_view(self, client):
        self.create_user_and_login(client)

        Staff(id_user='******').save()
        response = client.get('/accounts/edit/456/')
        assert response.status_code == 200