<commit_before>(function () {
  // Odin.BaseField
  // --------------
  test("Odin.BaseField - hasDefault", function () {
    var field = new Odin.BaseField({defaultValue: 123});

    ok(field.hasDefault());
    equal(field.getDefault(), 123);
  });

  test("Odin.BaseField - noDefault", function () {
    var field = new Odin.BaseField();

    ok(!field.hasDefault());
    equal(field.getDefault(), null);
  });

  test("Odin.BaseField - setAttributesFromName", function () {
    var field = new Odin.BaseField();

    equal(field.name, null);
    field.setAttributesFromName('a_name');
    equal(field.name, 'a_name');
    equal(field.attname, 'a_name');
    equal(field.verboseName, 'a name');
    equal(field.verboseNamePlural, 'a names');
  });

  test("Odin.BaseField - setAttributesFromName name specified", function () {
    var field = new Odin.BaseField({name: 'dave'});

    equal(field.name, 'dave');
    field.setAttributesFromName('a_name');
    equal(field.name, 'dave');
    equal(field.attname, 'a_name');
    equal(field.verboseName, 'dave');
    equal(field.verboseNamePlural, 'daves');
  });

  test("Odin.BaseField - clean null", function () {
    throws(function () {
      (new Odin.BaseField()).clean(null);
    }, Odin.ValidationError, 'Not null');

    equal((new Odin.BaseField({allowNull:true})).clean(null), null)

  });

  // Odin.IntegerField
  // -----------------
  test("Odin.IntegerField - default", function () {
    var field = new Odin.IntegerField();

    strictEqual(field.clean(1), 1);
    strictEqual(field.clean('1'), 1);
    throws(function () { field.clean(null)}, Odin.ValidationError);
    throws(function () { field.clean("abc")}, Odin.ValidationError);
    throws(function () { field.clean("")}, Odin.ValidationError);
  });

  test("Odin.IntegerField - allow null", function () {
    var field = new Odin.IntegerField({allowNull: true});

    strictEqual(field.clean(1), 1);
    strictEqual(field.clean('1'), 1);
    strictEqual(field.clean(null), null);
    throws(function () { field.clean("abc")}, Odin.ValidationError);
    strictEqual(field.clean(""), null);
  });

  test("Odin.IntegerField - validators", function () {
    var field = new Odin.IntegerField({minValue: 10, maxValue: 20});

    field.validators =

    strictEqual(field.clean(1), 1);
    strictEqual(field.clean('1'), 1);
    strictEqual(field.clean(null), null);
    throws(function () { field.clean("abc")}, Odin.ValidationError);
    strictEqual(field.clean(""), null);
  });

  // Odin.StringField
  // ----------------

}());<commit_msg>Disabled test in progress<commit_after>(function () {
  // Odin.BaseField
  // --------------
  test("Odin.BaseField - hasDefault", function () {
    var field = new Odin.BaseField({defaultValue: 123});

    ok(field.hasDefault());
    equal(field.getDefault(), 123);
  });

  test("Odin.BaseField - noDefault", function () {
    var field = new Odin.BaseField();

    ok(!field.hasDefault());
    equal(field.getDefault(), null);
  });

  test("Odin.BaseField - setAttributesFromName", function () {
    var field = new Odin.BaseField();

    equal(field.name, null);
    field.setAttributesFromName('a_name');
    equal(field.name, 'a_name');
    equal(field.attname, 'a_name');
    equal(field.verboseName, 'a name');
    equal(field.verboseNamePlural, 'a names');
  });

  test("Odin.BaseField - setAttributesFromName name specified", function () {
    var field = new Odin.BaseField({name: 'dave'});

    equal(field.name, 'dave');
    field.setAttributesFromName('a_name');
    equal(field.name, 'dave');
    equal(field.attname, 'a_name');
    equal(field.verboseName, 'dave');
    equal(field.verboseNamePlural, 'daves');
  });

  test("Odin.BaseField - clean null", function () {
    throws(function () {
      (new Odin.BaseField()).clean(null);
    }, Odin.ValidationError, 'Not null');

    equal((new Odin.BaseField({allowNull:true})).clean(null), null)

  });

  // Odin.IntegerField
  // -----------------
  test("Odin.IntegerField - default", function () {
    var field = new Odin.IntegerField();

    strictEqual(field.clean(1), 1);
    strictEqual(field.clean('1'), 1);
    throws(function () { field.clean(null)}, Odin.ValidationError);
    throws(function () { field.clean("abc")}, Odin.ValidationError);
    throws(function () { field.clean("")}, Odin.ValidationError);
  });

  test("Odin.IntegerField - allow null", function () {
    var field = new Odin.IntegerField({allowNull: true});

    strictEqual(field.clean(1), 1);
    strictEqual(field.clean('1'), 1);
    strictEqual(field.clean(null), null);
    throws(function () { field.clean("abc")}, Odin.ValidationError);
    strictEqual(field.clean(""), null);
  });

//  test("Odin.IntegerField - validators", function () {
//    var field = new Odin.IntegerField({minValue: 10, maxValue: 20});
//
//    strictEqual(field.clean(1), 1);
//    strictEqual(field.clean('1'), 1);
//    strictEqual(field.clean(null), null);
//    throws(function () { field.clean("abc")}, Odin.ValidationError);
//    strictEqual(field.clean(""), null);
//  });

  // Odin.StringField
  // ----------------

}());
{'fraction_non_alphanumeric': 0.2029606544604597, 'fraction_numerical': 0.008570315543435918, 'mean_word_length': 3.4574652777777777, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7507485', 'n_tokens_mistral': 1697, 'n_tokens_neox': 1619, 'n_words': 284}