본문 바로가기

TIL

TIL 070523

https://www.freecodecamp.org/korean/news/giteseo-keomis-doedolrigi-majimag-keomiseul-cwisohaneun-bangbeob/

 

Git에서 커밋 되돌리기 - 마지막 커밋을 취소하는 방법

Git에서 코드 작업을 하고 있는데 계획대로 되지 않아서 가장 최근 커밋을 되돌려야 한다고 가정해봅시다. 어쩌면 좋을까요? 방법에 대해 알아봅시다! 마지막 커밋을 취소할 수 있는 두 가지 방

www.freecodecamp.org

html에 maxlength 제한하는걸로 커밋했다가 같은 동작을 jquery로 바꿨다.

log에 남길 필요 없을 것 같아서 되돌리고 다시 커밋.

git reset --hard HEAD~1


팔로우 리스트는 페이지네이션을 하지 않고 5명을 넘어가면 스크롤바가 생기도록 만들었다.

overflow-y: auto;

max-height를 지정해준 후 하면 된다.

https://electronic-moongchi.tistory.com/62

 

[css] overflow-x 와 overflow-y 의 속성

[css] overflow-x 와 overflow-y 의 속성 이전에 overflow 속성에 대해서 배웠는데, overflow 속성은 요소의 박스에 내용이 더 길때, 어떻게 보일지 선택하는 속성이다. overflow (visible, hidden, scroll, auto) 속성 보

electronic-moongchi.tistory.com


setuptestdata에서 이미지가 없는 review를 create해준 후 나중에 이미지가 있는 리뷰를 수정하기 테스트 코드에서 이미지만 따로 넣어주고 싶었는데 그냥 .image=imagefile.name하니까 에러가 났다.

에러 메세지에 set 어쩌구 라고 나와서 set_password처럼 image에 set을 적용해봤지만 에러가 났다.

이미지 파일의 이름이 아니라 경로를 넣어줘야한다고 나와서 media 폴더 경로를 넣어줬지만 에러가 났다.

.image.path에 넣어줬지만 에러가 났다.

검색해보니 SimpleUploadedFile 뭐 이런게 있어서 사용해봤는데 에러가 났다.

https://stackoverflow.com/questions/26298821/django-testing-model-with-imagefield

 

Django testing model with ImageField

I need to test the Photo model of my Django application. How can I mock the ImageField with a test image file? tests.py class PhotoTestCase(TestCase): def test_add_photo(self): newPh...

stackoverflow.com

그냥 .image=경로 이렇게 한 후 save() 해주니 해결됐다.

https://gist.github.com/abrookins/3440646

 

Set the path of an ImageField in Django

Set the path of an ImageField in Django. GitHub Gist: instantly share code, notes, and snippets.

gist.github.com

나중에 정 안되면 아예 이미지가 있는 리뷰를 새로 create 하려고 했었다.


data=encode_multipart(data=self.new_reviews_data[i], boundary=BOUNDARY),

 

이미지가 있는 리뷰를 수정하는 테스트 코드에서 두번째 data를 빼먹어서 에러가 났었다.

https://stackoverflow.com/questions/21764770/typeerror-got-multiple-values-for-argument

 

TypeError: got multiple values for argument

I read the other threads that had to do with this error and it seems that my problem has an interesting distinct difference than all the posts I read so far, namely, all the other posts so far have...

stackoverflow.com

 

'TIL' 카테고리의 다른 글

TIL 070723  (0) 2023.07.07
TIL 070623  (0) 2023.07.06
TIL 070423  (0) 2023.07.05
TIL 070323  (0) 2023.07.04
TIL 063023  (0) 2023.07.01