Skip to content

Commit

Permalink
Remove u prefix from strings in docs
Browse files Browse the repository at this point in the history
Removes a Python-2-ism from docs. Python 2 has not been supported since
ea37bfe (release 3.0.0).
  • Loading branch information
jdufresne committed Nov 16, 2020
1 parent 941750d commit a0967bb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ And now, we'll define the related factories:
account = factory.SubFactory(AccountFactory)
gender = factory.Iterator([objects.Profile.GENDER_MALE, objects.Profile.GENDER_FEMALE])
firstname = u'John'
lastname = u'Doe'
firstname = 'John'
lastname = 'Doe'
Expand All @@ -86,7 +86,7 @@ If we commonly use a specific variant of our objects, we can refine a factory ac
class FemaleProfileFactory(ProfileFactory):
gender = objects.Profile.GENDER_FEMALE
firstname = u'Jane'
firstname = 'Jane'
account__username = factory.Sequence(lambda n: 'jane%s' % n)
Expand Down
2 changes: 1 addition & 1 deletion docs/orms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ A (very) simple example:
sqlalchemy_session = session # the SQLAlchemy session object
id = factory.Sequence(lambda n: n)
name = factory.Sequence(lambda n: u'User %d' % n)
name = factory.Sequence(lambda n: 'User %d' % n)
.. code-block:: pycon
Expand Down
4 changes: 2 additions & 2 deletions docs/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ Since version 2.9, the :meth:`~factory.django.mute_signals` decorator should be
.. code-block:: pycon
>>> u = UserFactory(profile__title=u"Lord")
>>> u = UserFactory(profile__title="Lord")
>>> u.get_profile().title
u"Lord"
"Lord"
Such behavior can be extended to other situations where a signal interferes with
factory_boy related factories.
Expand Down
8 changes: 4 additions & 4 deletions docs/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -883,21 +883,21 @@ return value of the method:
class Meta:
model = User
name = u"Jean"
name = "Jean"
@factory.lazy_attribute
def email(self):
# Convert to plain ascii text
clean_name = (unicodedata.normalize('NFKD', self.name)
.encode('ascii', 'ignore')
.decode('utf8'))
return u'%s@example.com' % clean_name
return '%s@example.com' % clean_name
.. code-block:: pycon
>>> joel = UserFactory(name=u"Joël")
>>> joel = UserFactory(name="Joël")
>>> joel.email
u'joel@example.com'
'joel@example.com'
Sequence
Expand Down

0 comments on commit a0967bb

Please sign in to comment.