"""
 Ce fichier n'est utilisé que pour les tests.
"""
from django.test import TestCase
from numpy.core.fromnumeric import shape
import pandas as pd
from .utils_scoring import encoding,notePonderee,notations_test

# Create your tests here.

class InsertModelTest(TestCase):
    # Fonction pour la table Garnisons
    def test_scoring(self):
        """Pour tester la fonction de scoring
        """
        mut_test = notations_test()
        data_test = mut_test.to_dict('records')
        data_source = [{ 
                        'mu_id': 0,
                        'poste_id': 1,
                        'administres_id_sap': 9984,
                        'pam_id': 1,
                        'mu_date_execution': '14/06/2021',
                        'mu_note_militaire': 0.5,
                        'mu_flag_cple_ideal': 0,
                        'mu_decision': '',
                        'mu_date_decision': '',
                        'mu_notes_gestionnaire': '',
                        'mu_notes_partagees': ''},
                        {
                        'mu_id': 0,
                        'poste_id': 1,
                        'administres_id_sap': 56754,
                        'pam_id': 1,
                        'mu_date_execution': '14/06/2021',
                        'mu_note_militaire': 0.0,
                        'mu_flag_cple_ideal': 0,
                        'mu_decision': '',
                        'mu_date_decision': '',
                        'mu_notes_gestionnaire': '',
                        'mu_notes_partagees': ''},
                        {
                        'mu_id': 0,
                        'poste_id': 1,
                        'administres_id_sap': 78905,
                        'pam_id': 1,
                        'mu_date_execution': '14/06/2021',
                        'mu_note_militaire': 0.0,
                        'mu_flag_cple_ideal': 0,
                        'mu_decision': '',
                        'mu_date_decision': '',
                        'mu_notes_gestionnaire': '',
                        'mu_notes_partagees': ''
                        },
                        {
                        'mu_id': 0,
                        'poste_id': 2,
                        'administres_id_sap': 9984,
                        'pam_id': 1,
                        'mu_date_execution': '14/06/2021',
                        'mu_note_militaire': 0.0,
                        'mu_flag_cple_ideal': 0,
                        'mu_decision': '',
                        'mu_date_decision': '',
                        'mu_notes_gestionnaire': '',
                        'mu_notes_partagees': ''
                        },
                        {
                        'mu_id': 0,
                        'poste_id': 2,
                        'administres_id_sap': 56754,
                        'pam_id': 1,
                        'mu_date_execution': '14/06/2021',
                        'mu_note_militaire': 0.5,
                        'mu_flag_cple_ideal': 0,
                        'mu_decision': '',
                        'mu_date_decision': '',
                        'mu_notes_gestionnaire': '',
                        'mu_notes_partagees': ''
                        },
                        {
                        'mu_id': 0,
                        'poste_id': 2,
                        'administres_id_sap': 78905,
                        'pam_id': 1,
                        'mu_date_execution': '14/06/2021',
                        'mu_note_militaire': 0.0,
                        'mu_flag_cple_ideal': 0,
                        'mu_decision': '',
                        'mu_date_decision': '',
                        'mu_notes_gestionnaire': '',
                        'mu_notes_partagees': ''
                        },
                        {
                        'mu_id': 0,
                        'poste_id': 3,
                        'administres_id_sap': 9984,
                        'pam_id': 1,
                        'mu_date_execution': '14/06/2021',
                        'mu_note_militaire': 0.0,
                        'mu_flag_cple_ideal': 0,
                        'mu_decision': '',
                        'mu_date_decision': '',
                        'mu_notes_gestionnaire': '',
                        'mu_notes_partagees': ''
                        },
                        {
                        'mu_id': 0,
                        'poste_id': 3,
                        'administres_id_sap': 56754,
                        'pam_id': 1,
                        'mu_date_execution': '14/06/2021',
                        'mu_note_militaire': 0.0,
                        'mu_flag_cple_ideal': 0,
                        'mu_decision': '',
                        'mu_date_decision': '',
                        'mu_notes_gestionnaire': '',
                        'mu_notes_partagees': ''
                        },
                        {
                        'mu_id': 0,
                        'poste_id': 3,
                        'administres_id_sap': 78905,
                        'pam_id': 1,
                        'mu_date_execution': '14/06/2021',
                        'mu_note_militaire': 0.5,
                        'mu_flag_cple_ideal': 0,
                        'mu_decision': '',
                        'mu_date_decision': '',
                        'mu_notes_gestionnaire': '',
                        'mu_notes_partagees': ''
                        }]
        if data_source == data_test :
            test_value = True
        else :
            test_value = False
        self.assertIs(test_value,True)