Repository: joke2k/faker

Issue:
Add ability to generate lorem characters without punctuation
Sometimes I want to generate a string of characters of a specific length without any punctuation or capitalization but the lorem provider currently does not allow for this. 

Discussion:

Patch:
diff --git a/faker/providers/lorem/__init__.py b/faker/providers/lorem/__init__.py
index 5f07712d..dea4dd36 100644
--- a/faker/providers/lorem/__init__.py
+++ b/faker/providers/lorem/__init__.py
@@ -8,7 +8,8 @@ class Provider(BaseProvider):
     @classmethod
     def word(cls):
         """
-        :example 'Lorem'
+        Generate a random word
+        :example 'lorem'
         """
         return cls.random_element(cls.word_list)
 
diff --git a/faker/providers/python/__init__.py b/faker/providers/python/__init__.py
index 0b452478..4e5477b8 100644
--- a/faker/providers/python/__init__.py
+++ b/faker/providers/python/__init__.py
@@ -25,7 +25,7 @@ class Provider(BaseProvider):
 
     @classmethod
     def pystr(cls, max_chars=20):
-        return Lorem.text(max_chars)
+        return "".join(cls.random_letter() for i in range(max_chars))
 
     @classmethod
     def pyfloat(cls, left_digits=None, right_digits=None, positive=False):


Test patch:
diff --git a/faker/tests/__init__.py b/faker/tests/__init__.py
index 8c20e3d5..802bee4c 100644
--- a/faker/tests/__init__.py
+++ b/faker/tests/__init__.py
@@ -499,6 +499,20 @@ class FactoryTestCase(unittest.TestCase):
         sentence = provider.sentence(0)
         self.assertEqual(sentence, '')
 
+    def test_random_pystr_characters(self):
+        from faker.providers.python import Provider
+        provider = Provider(None)
+
+        characters = provider.pystr()
+        self.assertEqual(len(characters), 20)
+        characters = provider.pystr(max_chars=255)
+        self.assertEqual(len(characters), 255)
+        characters = provider.pystr(max_chars=0)
+        self.assertEqual(characters, '')
+        characters = provider.pystr(max_chars=-10)
+        self.assertEqual(characters, '')
+
+
     def test_us_ssn_valid(self):
         from faker.providers.ssn.en_US import Provider