Example #1
0
    def test_raw_filename_output_length(self):
        from model_mommy.utils import raw_filename

        length = 11
        value = raw_filename(length)
        self.assertEqual(len(value), length)

        length = 22
        value = raw_filename(length)
        self.assertEqual(len(value), length)

        length = 33
        value = raw_filename(length)
        self.assertEqual(len(value), length)
Example #2
0
    def test_raw_filename_with_supplied_ext_list_param(self):
        from model_mommy.utils import raw_filename
        from model_mommy.constants import FILE_EXT_LIST

        from os.path import splitext

        value = raw_filename(10, FILE_EXT_LIST)
        name, ext = splitext(value)

        self.assertTrue(ext in FILE_EXT_LIST)
Example #3
0
    def test_raw_filename_with_none_as_ext_list_param(self):
        from model_mommy.utils import raw_filename

        value = raw_filename(10, None)
        self.assertEqual(type(value), unicode)
Example #4
0
    def test_raw_filename_output_type(self):
        from model_mommy.utils import raw_filename

        value = raw_filename(10)
        self.assertEqual(type(value), unicode)