Reputation: 563
Hello Awesome People!
I have a Django project, already hosted. the project contains lots of functionalities. Sometimes, when I update a part of the project, I don't remember where these updates might affect.
Page 1
line 1: if obj.love_basket:
line 2: up.fan = True # as well
line 3: up.save()
After months, I want to remove fan
attribute and replace it with is_fan
Page 2
line 4: class UserProfile:
line 5: # fan = models.BooleanField()
line 6: is_fan = models.BooleanField()
This change will give an error in the future when a user hits line 2
This is just an example.
How will I know where these changes may affect?
Upvotes: 1
Views: 124
Reputation: 10397
Write unit tests! Things like that are an easy catch with a pretty simple unit test.
Upvotes: 1