Exemplo n.º 1
0
def reload_widgets():
    """Reload the default classifiers and widgets."""
    Classifier.delete_all_classifiers()
    Classifier.load_default_classifiers()

    Widget.delete_all_widgets()
    InteractiveWidget.load_default_widgets()
    NonInteractiveWidget.load_default_widgets()
Exemplo n.º 2
0
    def test_loading_and_deletion_of_classifiers(self):
        """Test loading and deletion of the default classifiers."""
        self.assertEqual(Classifier.objects.count(), 0)

        Classifier.load_default_classifiers()
        classifiers = Classifier.objects.all()
        classifier_ids = [classifier.id for classifier in classifiers]
        self.assertIn('Coord2DClassifier', classifier_ids)
        self.assertEqual(classifiers.count(), 7)

        Classifier.delete_all_classifiers()
        self.assertEqual(Classifier.objects.count(), 0)
Exemplo n.º 3
0
 def tearDown(self):
     """Delete all the default classifiers."""
     Classifier.delete_all_classifiers()